Sample code for 30+ languages & platforms
Node.js

Transition from Imap.FetchHeaders to Imap.FetchMsgSet

Provides instructions for replacing deprecated FetchHeaders method calls with FetchMsgSet.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var imap = new chilkat.Imap();

    //  ...
    //  ...

    var mset = new chilkat.MessageSet();
    success = imap.QueryMbx("FROM joe@example.com",true,mset);
    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  The FetchHeaders method is deprecated:

    // bundleObj: EmailBundle
    var bundleObj = imap.FetchHeaders(mset);
    if (imap.LastMethodSuccess == false) {
        console.log(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.

    var headersOnly = true;

    var bundleOut = new chilkat.EmailBundle();
    success = imap.FetchMsgSet(headersOnly,mset,bundleOut);
    if (success == false) {
        console.log(imap.LastErrorText);
        return;
    }


}

chilkatExample();