Node.js
Node.js
Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var imap = new chilkat.Imap();
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
// emailObj: Email
var emailObj = imap.FetchSingle(1,false);
if (imap.LastMethodSuccess == false) {
console.log(imap.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using FetchEmail.
// Your application creates a new, empty Email object which is passed
// in the last argument and filled upon success.
var headerOnly = false;
var email = new chilkat.Email();
success = imap.FetchEmail(headerOnly,1,false,email);
if (success == false) {
console.log(imap.LastErrorText);
return;
}
}
chilkatExample();