(PureBasic) 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.)
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkMime.pb"
IncludeFile "CkEmail.pb"
Procedure ChilkatExample()
email.i = CkEmail::ckCreate()
If email.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i = CkEmail::ckLoadEml(email,"qa_data/eml/sample.eml")
; Write the full MIME of the email to a StringBuilder.
sbMime.i = CkStringBuilder::ckCreate()
If sbMime.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkEmail::ckGetMimeSb(email,sbMime)
; Load the MIME object from the StringBuilder
mime.i = CkMime::ckCreate()
If mime.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkMime::ckLoadMimeSb(mime,sbMime)
Debug CkMime::ckGetMime(mime)
CkEmail::ckDispose(email)
CkStringBuilder::ckDispose(sbMime)
CkMime::ckDispose(mime)
ProcedureReturn
EndProcedure
|