Sample code for 30+ languages & platforms
C# 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 C# Downloads

C#
bool success = false;

Chilkat.Imap imap = new Chilkat.Imap();

//  ...
//  ...

//  The selected mailbox must contain these sequence numbers.
Chilkat.MessageSet sequenceNumbers = new Chilkat.MessageSet();
success = sequenceNumbers.FromCompactString("1:5");
if (success != true) {
    Debug.WriteLine(sequenceNumbers.LastErrorText);
    return;
}

int count = sequenceNumbers.Count;

//  Replace the deprecated FetchSequenceAsMime method using FetchSingleBd.

imap.AutoDownloadAttachments = true;

Chilkat.BinData bdMime = new Chilkat.BinData();
bool bUid = false;
int i = 0;
while (i < count) {
    success = imap.FetchSingleBd(sequenceNumbers.GetId(i),bUid,bdMime);
    //  ...
    //  ...

    i = i + 1;
}