Sample code for 30+ languages & platforms
Node.js

Transition from Imap.ListSubscribed to Imap.MbxList

Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var imap = new chilkat.Imap();

    //  ...
    //  ...

    var reference = "";
    var mbxPattern = "*";

    //  ------------------------------------------------------------------------
    //  The ListSubscribed method is deprecated:

    //  Lists only subscribed mailboxes.
    // mboxesObj: Mailboxes
    var mboxesObj = imap.ListSubscribed(reference,mbxPattern);
    if (imap.LastMethodSuccess == false) {
        console.log(imap.LastErrorText);
        return;
    }

    //  ...
    //  ...

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

    //  Lists only subscribed mailboxes.
    var subscribed = true;

    var mboxes = new chilkat.Mailboxes();
    success = imap.MbxList(subscribed,reference,mbxPattern,mboxes);
    if (success == false) {
        console.log(imap.LastErrorText);
        return;
    }


}

chilkatExample();