(C#) Transition from Imap.FetchSequenceHeaders to Imap.FetchRange
Provides instructions for replacing deprecated FetchSequenceHeaders 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;
// ------------------------------------------------------------------------
// The FetchSequenceHeaders method is deprecated:
Chilkat.EmailBundle bundleObj = imap.FetchSequenceHeaders(startSeqNum,count);
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 = true;
Chilkat.EmailBundle bundleOut = new Chilkat.EmailBundle();
bool success = imap.FetchRange(headersOnly,startSeqNum,count,bundleOut);
if (success == false) {
Debug.WriteLine(imap.LastErrorText);
return;
}
|