Node.js
Node.js
Transition from MailMan.TransferMail to MailMan.FetchAll
Provides instructions for replacing deprecated TransferMail method calls with FetchAll.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var mailman = new chilkat.MailMan();
// ...
// ...
// ------------------------------------------------------------------------
// The TransferMail method is deprecated:
// bundleObj: EmailBundle
var bundleObj = mailman.TransferMail();
if (mailman.LastMethodSuccess == false) {
console.log(mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchAll.
// Your application creates a new, empty EmailBundle object which is passed
// in the last argument and filled upon success.
var keepOnServer = false;
var headersOnly = false;
// Irrelevent because we are not downloading headers-only.
var numBodyLines = 0;
var bundleOut = new chilkat.EmailBundle();
success = mailman.FetchAll(keepOnServer,headersOnly,numBodyLines,bundleOut);
if (success == false) {
console.log(mailman.LastErrorText);
return;
}
}
chilkatExample();