Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from MailMan.LoadMime to Email.SetFromMimeText

Provides instructions for replacing deprecated LoadMime method calls with Email.SetFromMimeText.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

mailman = chilkat2.MailMan()

# ...
# ...

mimeText = "...."

# ------------------------------------------------------------------------
# The LoadMime method is deprecated:

# emailObj is a CkEmail
emailObj = mailman.LoadMime(mimeText)
if (mailman.LastMethodSuccess == False):
    print(mailman.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using Email.SetFromMimeText.

email = chilkat2.Email()
success = email.SetFromMimeText(mimeText)
if (success == False):
    print(email.LastErrorText)
    sys.exit()