Node.js
Node.js
Transition from MailMan.CopyMail to MailMan.FetchAll
Provides instructions for replacing deprecated CopyMail method calls with FetchAll.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var mailman = new chilkat.MailMan();
// ...
// ...
// ------------------------------------------------------------------------
// The CopyMail method is deprecated:
// bundleObj: EmailBundle
var bundleObj = mailman.CopyMail();
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 = true;
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();