(C#) Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd
Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd. Note: This example requires Chilkat v11.0.0 or greater.
Chilkat.Imap imap = new Chilkat.Imap();
// ...
// ...
Chilkat.MessageSet mset = new Chilkat.MessageSet();
bool success = imap.QueryMbx("FROM joe@example.com",true,mset);
// ...
// ...
// ------------------------------------------------------------------------
// The FetchBundleAsMime method is deprecated:
Chilkat.StringArray saObj = imap.FetchBundleAsMime(mset);
if (imap.LastMethodSuccess == false) {
Debug.WriteLine(imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchSingleBd.
imap.AutoDownloadAttachments = true;
Chilkat.BinData bdMime = new Chilkat.BinData();
bool bUid = mset.HasUids;
int numEmails = mset.Count;
int i = 0;
while (i < numEmails) {
success = imap.FetchSingleBd(mset.GetId(i),bUid,bdMime);
// ...
// ...
i = i + 1;
}
|