![]() |
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
(AutoIt) Attach Email as message/rfc822 sub-part to an EmailDemonstrates how to add attach a message/rfc822 email to another email.
; In this example, we'll attach an email loaded from a .eml file to a new email. Local $bSuccess Local $oEmlBytes $oFac = ObjCreate("Chilkat_9_5_0.FileAccess") $oEmlBytes = $oFac.ReadEntireFile("qa_data/eml/simple.eml") $oEmail = ObjCreate("Chilkat_9_5_0.Email") $oEmail.Subject = "This is a test email with an attached email." $oEmail.Body = "Test with attached email." $oEmail.AddTo("Joe","joe@example.com") $oEmail.From = "mary@example.com" $bSuccess = $oEmail.AttachMessage($oEmlBytes) ConsoleWrite($oEmail.GetMime() & @CRLF) ; ---------------------------------------------------------------------- ; Alternatively, we could do this: $oEmailToBeAttached = ObjCreate("Chilkat_9_5_0.Email") $bSuccess = $oEmailToBeAttached.LoadEml("qa_data/eml/simple.eml") $oEmail2 = ObjCreate("Chilkat_9_5_0.Email") $oEmail2.Subject = "This is a test email with an attached email." $oEmail2.Body = "Test with attached email." $oEmail2.AddTo("Joe","joe@example.com") $oEmail2.From = "mary@example.com" Local $oEmlBytes2 $oEmlBytes2 = $oEmailToBeAttached.GetMimeBinary() $bSuccess = $oEmail2.AttachMessage($oEmlBytes2) ConsoleWrite("----" & @CRLF) ConsoleWrite($oEmail2.GetMime() & @CRLF) |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.