(C#) Transition from Imap.FetchHeaders to Imap.FetchMsgSet
Provides instructions for replacing deprecated FetchHeaders method calls with FetchMsgSet. 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 FetchHeaders method is deprecated:
Chilkat.EmailBundle bundleObj = imap.FetchHeaders(mset);
if (imap.LastMethodSuccess == false) {
Debug.WriteLine(imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchMsgSet.
// 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.FetchMsgSet(headersOnly,mset,bundleOut);
if (success == false) {
Debug.WriteLine(imap.LastErrorText);
return;
}
|