Sample code for 30+ languages & platforms
CkPython

Transition from MailMan.LoadXmlEmailString to Email.SetFromXmlText

Provides instructions for replacing deprecated LoadXmlEmailString method calls with Email.SetFromXmlText.

Chilkat CkPython Downloads

CkPython
import sys
import chilkat

success = False

mailman = chilkat.CkMailMan()

# ...
# ...

xmlStr = "..."

# ------------------------------------------------------------------------
# The LoadXmlEmailString method is deprecated:

# emailObj is a CkEmail
emailObj = mailman.LoadXmlEmailString(xmlStr)
if (mailman.get_LastMethodSuccess() == False):
    print(mailman.lastErrorText())
    sys.exit()

# ...
# ...

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

email = chilkat.CkEmail()
success = email.SetFromXmlText(xmlStr)
if (success == False):
    print(email.lastErrorText())
    sys.exit()