AutoIt
AutoIt
Iterate Email Headers
Demonstrates how to iterate over the email header fields.Chilkat AutoIt Downloads
Local $bSuccess = False
$oEmail = ObjCreate("Chilkat.Email")
; 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...
$bSuccess = $oEmail.LoadEml("testReceivedHdrs.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
; How many header fields?
Local $iN
$iN = $oEmail.NumHeaderFields
If ($iN > 0) Then
; Display the name and value of each header:
Local $i
Local $sName
Local $sValue
For $i = 0 To $iN - 1
$sName = $oEmail.GetHeaderFieldName($i)
$sValue = $oEmail.GetHeaderFieldValue($i)
ConsoleWrite($i & @CRLF)
ConsoleWrite($sName & @CRLF)
ConsoleWrite($sValue & @CRLF)
Next
EndIf