Sample code for 30+ languages & platforms
Python Requires Chilkat v11.0.0+

Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd. The code below uses the replacement API without constructing the deprecated returned array.

Chilkat Python Downloads

Python
import sys
import chilkat2

success = False

imap = chilkat2.Imap()

# ...
# ...

# The selected mailbox must contain these sequence numbers.
sequenceNumbers = chilkat2.MessageSet()
success = sequenceNumbers.FromCompactString("1:5")
if (success != True):
    print(sequenceNumbers.LastErrorText)
    sys.exit()

count = sequenceNumbers.Count

# Replace the deprecated FetchSequenceAsMime method using FetchSingleBd.

imap.AutoDownloadAttachments = True

bdMime = chilkat2.BinData()
bUid = False
i = 0
while i < count :
    success = imap.FetchSingleBd(sequenceNumbers.GetId(i),bUid,bdMime)
    # ...
    # ...

    i = i + 1