Sample code for 30+ languages & platforms
PowerBuilder

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Email
oleobject loo_SbMime
oleobject loo_Mime

li_Success = 0

loo_Email = create oleobject
li_rc = loo_Email.ConnectToNewObject("Chilkat.Email")
if li_rc < 0 then
    destroy loo_Email
    MessageBox("Error","Connecting to COM object failed")
    return
end if
li_Success = loo_Email.LoadEml("qa_data/eml/sample.eml")

// Write the full MIME of the email to a StringBuilder.
loo_SbMime = create oleobject
li_rc = loo_SbMime.ConnectToNewObject("Chilkat.StringBuilder")

loo_Email.GetMimeSb(loo_SbMime)

// Load the MIME object from the StringBuilder
loo_Mime = create oleobject
li_rc = loo_Mime.ConnectToNewObject("Chilkat.Mime")

li_Success = loo_Mime.LoadMimeSb(loo_SbMime)

Write-Debug loo_Mime.GetMime()


destroy loo_Email
destroy loo_SbMime
destroy loo_Mime