Sample code for 30+ languages & platforms
Node.js

Transition from Imap.FetchChunk to Imap.FetchRange

Provides instructions for replacing deprecated FetchChunk method calls with FetchRange.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var imap = new chilkat.Imap();

    //  ...
    //  ...

    var startSeqNum = 1;
    var count = 5;

    var failedSet = new chilkat.MessageSet();
    var fetchedSet = new chilkat.MessageSet();

    //  ------------------------------------------------------------------------
    //  The FetchChunk method is deprecated:

    // bundleObj: EmailBundle
    var bundleObj = imap.FetchChunk(startSeqNum,count,failedSet,fetchedSet);
    if (imap.LastMethodSuccess == false) {
        console.log(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.

    var headersOnly = false;

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


}

chilkatExample();