Node.js
Node.js
Transition from MailMan.FetchSingleHeader to MailMan.FetchOne
Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchOne.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var mailman = new chilkat.MailMan();
// ...
// ...
var numBodyLines = 5;
var msgnum = 1;
// ------------------------------------------------------------------------
// The FetchSingleHeader method is deprecated:
// emailObj: Email
var emailObj = mailman.FetchSingleHeader(numBodyLines,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 = true;
var emailOut = new chilkat.Email();
success = mailman.FetchOne(headerOnly,numBodyLines,msgnum,emailOut);
if (success == false) {
console.log(mailman.LastErrorText);
return;
}
}
chilkatExample();