Sample code for 30+ languages & platforms
Node.js

Transition from Imap.FetchSingleHeader to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var imap = new chilkat.Imap();

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  The FetchSingleHeader method is deprecated:

    // emailObj: Email
    var emailObj = imap.FetchSingleHeader(1,false);
    if (imap.LastMethodSuccess == false) {
        console.log(imap.LastErrorText);
        return;
    }

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  Do the equivalent using FetchEmail.
    //  Your application creates a new, empty Email object which is passed 
    //  in the last argument and filled upon success.

    var headerOnly = true;

    var emailOut = new chilkat.Email();
    success = imap.FetchEmail(headerOnly,1,false,emailOut);
    if (success == false) {
        console.log(imap.LastErrorText);
        return;
    }


}

chilkatExample();