AutoIt Requires Chilkat v11.0.0+
AutoIt
Read an attached email
See more Email Object Examples
Open forward-as-attachment.eml from the forwarding example. Read the cover note’s subject, then open each attached message and inspect its own headers and attachment count. This works even when the outer message has no ordinary files.
Chilkat AutoIt Downloads
Local $bSuccess = False
; Assumes Chilkat is unlocked. See Global Unlock Sample.
$oWrapper = ObjCreate("Chilkat.Email")
$bSuccess = $oWrapper.LoadEml("forward-as-attachment.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oWrapper.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Cover note: " & $oWrapper.Subject & @CRLF)
If ($oWrapper.NumAttachedMessages = 0) Then
ConsoleWrite("No attached messages." & @CRLF)
Exit
EndIf
$oNested = ObjCreate("Chilkat.Email")
Local $i = 0
While ($i < $oWrapper.NumAttachedMessages)
$bSuccess = $oWrapper.GetAttachedEmail($i,$oNested)
If ($bSuccess <> True) Then
ConsoleWrite($oWrapper.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Original author: " & $oNested.From & @CRLF)
ConsoleWrite("Original subject: " & $oNested.Subject & @CRLF)
ConsoleWrite("Files on the original: " & $oNested.NumAttachments & @CRLF)
$i = $i + 1
Wend