Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

imap = chilkat2.Imap()

# ...
# ...

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

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

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

# ...
# ...

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

imap.AutoDownloadAttachments = True

bdMime = chilkat2.BinData()
bUid = mset.HasUids
numEmails = mset.Count
i = 0
while i < numEmails :
    success = imap.FetchSingleBd(mset.GetId(i),bUid,bdMime)
    # ...
    # ...

    i = i + 1