So, I currently have a node.js project that uses chilkat in order to read emails. Currently it does most of what I'm looking for, returning the subject, header, and the email address of each email. The only thing I can't get to return is the body text. Currently when I try to do so, it returns either an empty of null
result.
I know why the problem happens. It's because I am only fetching email header info here before trying to print the result:
var bundle;
bundle = imap.FetchHeaders(messageSet);
if (imap.LastMethodSuccess == false) {
console.log(imap.LastErrorText);
return;
}
var i = 0;
while (i < bundle.MessageCount) {
// email: Email
var email;
email = bundle.GetEmail(i);
console.log(email.GetHeaderField("Date"));
console.log(email.Subject);
console.log(email.From);
console.log(email.Body);
console.log("--");
i = i+1;
}
So, I know the fix should happen here, but for the life of me I can't find what should go in place the the imap.FetchHeaders()
part.