Sample code for 30+ languages & platforms
C#

Transition from Imap.FetchChunk to Imap.FetchRange

Provides instructions for replacing deprecated FetchChunk method calls with FetchRange.

Chilkat C# Downloads

C#
bool success = false;

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

// ...
// ...

int startSeqNum = 1;
int count = 5;

Chilkat.MessageSet failedSet = new Chilkat.MessageSet();
Chilkat.MessageSet fetchedSet = new Chilkat.MessageSet();

// ------------------------------------------------------------------------
// The FetchChunk method is deprecated:

Chilkat.EmailBundle bundleObj = imap.FetchChunk(startSeqNum,count,failedSet,fetchedSet);
if (imap.LastMethodSuccess == false) {
    Debug.WriteLine(imap.LastErrorText);
    return;
}

// ...
// ...

// ------------------------------------------------------------------------
// Do the equivalent using FetchRange.
// Your application creates a new, empty EmailBundle object which is passed 
// in the last argument and filled upon success.

bool headersOnly = false;

Chilkat.EmailBundle bundleOut = new Chilkat.EmailBundle();
success = imap.FetchRange(headersOnly,startSeqNum,count,bundleOut);
if (success == false) {
    Debug.WriteLine(imap.LastErrorText);
    return;
}