Node.js
Node.js
Transition from MailMan.FetchEmail to MailMan.FetchByUidl
Provides instructions for replacing deprecated FetchEmail method calls with FetchByUidl.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var mailman = new chilkat.MailMan();
// ...
// ...
var uidl = "123";
// ------------------------------------------------------------------------
// The FetchEmail method is deprecated:
// emailObj: Email
var emailObj = mailman.FetchEmail(uidl);
if (mailman.LastMethodSuccess == false) {
console.log(mailman.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchByUidl.
// 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.FetchByUidl(uidl,headerOnly,numBodyLines,emailOut);
if (success == false) {
console.log(mailman.LastErrorText);
return;
}
}
chilkatExample();