(Chilkat2-Python) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
import sys
import chilkat2
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()
|