(VBScript) Load MIME Object from Email Object
Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Email")
set email = CreateObject("Chilkat.Email")
success = email.LoadEml("qa_data/eml/sample.eml")
' Write the full MIME of the email to a StringBuilder.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sbMime = CreateObject("Chilkat.StringBuilder")
success = email.GetMimeSb(sbMime)
' Load the MIME object from the StringBuilder
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Mime")
set mime = CreateObject("Chilkat.Mime")
success = mime.LoadMimeSb(sbMime)
outFile.WriteLine(mime.GetMime())
outFile.Close
|