AutoIt Requires Chilkat v11.0.0+
AutoIt
Create a message disposition notification
See more Email Object Examples
An MDN describes a recipient-side event such as displaying a message. Create one only when the application has an appropriate request and the recipient has consented. Set Final-Recipient from the actual receiving mailbox. MDN format.
Chilkat AutoIt Downloads
Local $bSuccess = False
; Assumes Chilkat is unlocked. See Global Unlock Sample.
$oEmail = ObjCreate("Chilkat.Email")
$bSuccess = $oEmail.LoadEml("message.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
$oFields = ObjCreate("Chilkat.Xml")
$oFields.Tag = "DispositionFields"
$oFields.NewChild2 "Final-Recipient","rfc822; alex@example.net"
Local $sOriginalId = $oEmail.GetHeaderField("Message-ID")
If ($sOriginalId <> "") Then
$oFields.NewChild2 "Original-Message-ID",$sOriginalId
EndIf
$oFields.NewChild2 "Disposition","manual-action/MDN-sent-manually; displayed"
$oReport = ObjCreate("Chilkat.Email")
$bSuccess = $oEmail.ToMdn("The recipient displayed your message.",$oFields.GetXml(),True,$oReport)
If ($bSuccess <> True) Then
ConsoleWrite($oEmail.LastErrorText & @CRLF)
Exit
EndIf
$oReport.From = "Alex Rivera <alex@example.net>"
$bSuccess = $oReport.SaveEml("disposition.eml")
If ($bSuccess <> True) Then
ConsoleWrite($oReport.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Saved disposition.eml." & @CRLF)