Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Attach Email as message/rfc822 sub-part to an EmailDemonstrates how to add attach a message/rfc822 email to another email.
integer li_rc integer li_Success oleobject loo_Fac oleobject loo_Email oleobject loo_EmailToBeAttached oleobject loo_Email2 // In this example, we'll attach an email loaded from a .eml file to a new email. loo_Fac = create oleobject // Use "Chilkat_9_5_0.FileAccess" for versions of Chilkat < 10.0.0 li_rc = loo_Fac.ConnectToNewObject("Chilkat.FileAccess") if li_rc < 0 then destroy loo_Fac MessageBox("Error","Connecting to COM object failed") return end if loo_EmlBytes = loo_Fac.ReadEntireFile("qa_data/eml/simple.eml") loo_Email = create oleobject // Use "Chilkat_9_5_0.Email" for versions of Chilkat < 10.0.0 li_rc = loo_Email.ConnectToNewObject("Chilkat.Email") loo_Email.Subject = "This is a test email with an attached email." loo_Email.Body = "Test with attached email." loo_Email.AddTo("Joe","joe@example.com") loo_Email.From = "mary@example.com" li_Success = loo_Email.AttachMessage(loo_EmlBytes) Write-Debug loo_Email.GetMime() // ---------------------------------------------------------------------- // Alternatively, we could do this: loo_EmailToBeAttached = create oleobject // Use "Chilkat_9_5_0.Email" for versions of Chilkat < 10.0.0 li_rc = loo_EmailToBeAttached.ConnectToNewObject("Chilkat.Email") li_Success = loo_EmailToBeAttached.LoadEml("qa_data/eml/simple.eml") loo_Email2 = create oleobject // Use "Chilkat_9_5_0.Email" for versions of Chilkat < 10.0.0 li_rc = loo_Email2.ConnectToNewObject("Chilkat.Email") loo_Email2.Subject = "This is a test email with an attached email." loo_Email2.Body = "Test with attached email." loo_Email2.AddTo("Joe","joe@example.com") loo_Email2.From = "mary@example.com" loo_EmlBytes2 = loo_EmailToBeAttached.GetMimeBinary() li_Success = loo_Email2.AttachMessage(loo_EmlBytes2) Write-Debug "----" Write-Debug loo_Email2.GetMime() destroy loo_Fac destroy loo_Email destroy loo_EmailToBeAttached destroy loo_Email2 |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.