(C#) Transition from Imap.FetchChunk to Imap.FetchRange
Provides instructions for replacing deprecated FetchChunk method calls with FetchRange. Note: This example requires Chilkat v11.0.0 or greater.
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();
bool success = imap.FetchRange(headersOnly,startSeqNum,count,bundleOut);
if (success == false) {
Debug.WriteLine(imap.LastErrorText);
return;
}
|