Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29755

How can I read an email's body text with Chilkat and Node.js?

$
0
0

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.


Viewing all articles
Browse latest Browse all 29755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>