Sample code for 30+ languages & platforms
CkPython

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

Chilkat CkPython Downloads

CkPython
import sys
import chilkat

success = False

imap = chilkat.CkImap()

# ...
# ...

mset = chilkat.CkMessageSet()
success = imap.QueryMbx("FROM joe@example.com",True,mset)
# ...
# ...

# ------------------------------------------------------------------------
# The FetchBundleAsMime method is deprecated:

# saObj is a CkStringArray
saObj = imap.FetchBundleAsMime(mset)
if (imap.get_LastMethodSuccess() == False):
    print(imap.lastErrorText())
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using FetchSingleBd.

imap.put_AutoDownloadAttachments(True)

bdMime = chilkat.CkBinData()
bUid = mset.get_HasUids()
numEmails = mset.get_Count()
i = 0
while i < numEmails :
    success = imap.FetchSingleBd(mset.GetId(i),bUid,bdMime)
    # ...
    # ...

    i = i + 1