Sample code for 30+ languages & platforms
Node.js

Transition from MailMan.FetchByMsgnum to MailMan.FetchOne

Provides instructions for replacing deprecated FetchByMsgnum method calls with FetchOne.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var mailman = new chilkat.MailMan();

    //  ...
    //  ...

    var msgnum = 123;

    //  ------------------------------------------------------------------------
    //  The FetchByMsgnum method is deprecated:

    // emailObj: Email
    var emailObj = mailman.FetchByMsgnum(msgnum);
    if (mailman.LastMethodSuccess == false) {
        console.log(mailman.LastErrorText);
        return;
    }

    //  ...
    //  ...

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

    var headerOnly = false;
    //  Irrelevant because we are not downloading headers-only.
    var numBodyLines = 0;

    var emailOut = new chilkat.Email();
    success = mailman.FetchOne(headerOnly,numBodyLines,msgnum,emailOut);
    if (success == false) {
        console.log(mailman.LastErrorText);
        return;
    }


}

chilkatExample();