Sample code for 30+ languages & platforms
C#

Transition from Imap.FetchHeaders to Imap.FetchMsgSet

Provides instructions for replacing deprecated FetchHeaders method calls with FetchMsgSet.

Chilkat C# Downloads

C#
bool success = false;

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

//  ...
//  ...

Chilkat.MessageSet mset = new Chilkat.MessageSet();
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();
success = imap.FetchMsgSet(headersOnly,mset,bundleOut);
if (success == false) {
    Debug.WriteLine(imap.LastErrorText);
    return;
}