Chilkat2-Python
Chilkat2-Python
Transition from MailMan.TransferMultipleMime to MailMan.FetchMimeBd
Provides instructions for replacing deprecated TransferMultipleMime method calls with FetchMimeBd.Chilkat Chilkat2-Python Downloads
import sys
import chilkat2
success = False
mailman = chilkat2.MailMan()
# ...
# ...
saUidls = chilkat2.StringArray()
saUidls.Append("aaa")
saUidls.Append("bbb")
saUidls.Append("ccc")
stUidls = chilkat2.StringTable()
stUidls.Append("aaa")
stUidls.Append("bbb")
stUidls.Append("ccc")
# ------------------------------------------------------------------------
# The TransferMultipleMime method is deprecated:
# sa is a CkStringArray
sa = mailman.TransferMultipleMime(saUidls)
if (mailman.LastMethodSuccess == False):
print(mailman.LastErrorText)
sys.exit()
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using FetchMimeBd.
mailman.ImmediateDelete = False
success = False
bdMime = chilkat2.BinData()
numUidls = stUidls.Count
i = 0
while i < numUidls :
success = mailman.FetchMimeBd(stUidls.StringAt(i),bdMime)
# ...
# Mark the email for deletion.
success = mailman.DeleteByUidl(stUidls.StringAt(i))
# ...
i = i + 1
# emails marked for deletion will be deleted at this time
success = mailman.Pop3EndSession()