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
(Tcl) Attach Email as message/rfc822 sub-part to an EmailDemonstrates how to add attach a message/rfc822 email to another email.
load ./chilkat.dll # In this example, we'll attach an email loaded from a .eml file to a new email. set emlBytes [new_CkByteData] set fac [new_CkFileAccess] set success [CkFileAccess_ReadEntireFile $fac "qa_data/eml/simple.eml" $emlBytes] set email [new_CkEmail] CkEmail_put_Subject $email "This is a test email with an attached email." CkEmail_put_Body $email "Test with attached email." CkEmail_AddTo $email "Joe" "joe@example.com" CkEmail_put_From $email "mary@example.com" set success [CkEmail_AttachMessage $email $emlBytes] puts [CkEmail_getMime $email] # ---------------------------------------------------------------------- # Alternatively, we could do this: set emailToBeAttached [new_CkEmail] set success [CkEmail_LoadEml $emailToBeAttached "qa_data/eml/simple.eml"] set email2 [new_CkEmail] CkEmail_put_Subject $email2 "This is a test email with an attached email." CkEmail_put_Body $email2 "Test with attached email." CkEmail_AddTo $email2 "Joe" "joe@example.com" CkEmail_put_From $email2 "mary@example.com" set emlBytes2 [new_CkByteData] set success [CkEmail_GetMimeBinary $emailToBeAttached $emlBytes2] set success [CkEmail_AttachMessage $email2 $emlBytes2] puts "----" puts [CkEmail_getMime $email2] delete_CkByteData $emlBytes delete_CkFileAccess $fac delete_CkEmail $email delete_CkEmail $emailToBeAttached delete_CkEmail $email2 delete_CkByteData $emlBytes2 |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.