I'm using node-imap to get my Gmail e-mails and although their example runs pretty well, I'm not being able to only print the msg.To, msg.Body, and msg.From. I can only print the entire message, which is a lot.
Thanks.
According to the documentation for node-imap, the To and From headers are available in the msg.headers, which includes the To and From. In order to retrieve the body you must append a variable every time the chunk event is emitted, and upon end you should have a completed body. The headers will probably also not be fully available until the end event has been triggered, so you must take that into account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With