Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Iterate Email HeadersDemonstrates how to iterate over the email header fields.
Use ChilkatAx-win32.pkg Procedure Test Handle hoEmail Boolean iSuccess Integer n Integer i String sName String sValue String sTemp1 Get Create (RefClass(cComChilkatEmail)) To hoEmail If (Not(IsComObjectCreated(hoEmail))) Begin Send CreateComObject of hoEmail End // First, load an email from a file. // Note: an email object may be loaded from a file, or // downloaded directly from a POP3 or IMAP server... Get ComLoadEml Of hoEmail "testReceivedHdrs.eml" To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoEmail To sTemp1 Showln sTemp1 Procedure_Return End // How many header fields? Get ComNumHeaderFields Of hoEmail To n If (n > 0) Begin // Display the name and value of each header: For i From 0 To (n - 1) Get ComGetHeaderFieldName Of hoEmail i To sName Get ComGetHeaderFieldValue Of hoEmail i To sValue Showln i Showln sName Showln sValue Loop End End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.