Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Imap.FetchSingle to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

imap = chilkat2.Imap()

# ...
# ...

# ------------------------------------------------------------------------
# The FetchSingle method is deprecated:

# emailObj is a CkEmail
emailObj = imap.FetchSingle(1,False)
if (imap.LastMethodSuccess == False):
    print(imap.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using FetchEmail.
# Your application creates a new, empty Email object which is passed 
# in the last argument and filled upon success.

headerOnly = False

email = chilkat2.Email()
success = imap.FetchEmail(headerOnly,1,False,email)
if (success == False):
    print(imap.LastErrorText)
    sys.exit()