Sample code for 30+ languages & platforms
Node.js

Transition from Imap.FetchSequenceAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchSequenceAsMime method calls with FetchSingleBd.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var imap = new chilkat.Imap();

    //  ...
    //  ...

    var startSeqNum = 1;
    var count = 5;

    //  ------------------------------------------------------------------------
    //  The FetchSequenceAsMime method is deprecated:

    // sa: StringArray
    var sa = imap.FetchSequenceAsMime(startSeqNum,count);
    if (imap.LastMethodSuccess == false) {
        console.log(imap.LastErrorText);
        return;
    }

    //  ...
    //  ...

    //  ------------------------------------------------------------------------
    //  Do the equivalent using FetchSingleBd.

    imap.AutoDownloadAttachments = true;

    success = false;
    var bdMime = new chilkat.BinData();
    var bUid = false;
    var i = 0;
    while (i < count) {
        success = imap.FetchSingleBd(startSeqNum+i,bUid,bdMime);
        //  ...
        //  ...

        i = i+1;
    }


}

chilkatExample();