How to get mail content?

165 views
Skip to first unread message

Javier Aguero

unread,
Dec 22, 2016, 1:56:10 PM12/22/16
to Email.js Mailing List
How i can get the mail content by message.uid?

I testing emaijs-imap with electron, i got this


client.connect().then(() => {

var mailbox = client.selectMailbox('INBOX');

client.listMessages('INBOX', '1:10', ['uid', 'flags', 'envelope', 'bodystructure', 'body']).then((messages) => {
            messages.forEach((message) => { 

                console.log("Body:" + message.body.peek );  //dont work...
                
             console.log('Flags for ' + message.uid + ' | De:  ' + message.envelope.from[0].name + ' (' + message.envelope.from[0].address + ') Asunto:' + message.envelope.subject);

                
        });
});




How i can get mail content.. html or text.

Thanks!

netop...@thenetwork.email

unread,
Jan 8, 2017, 12:29:34 AM1/8/17
to Email.js Mailing List
I haven't figured this out either, but I know why your peek code doesn't work. You need to add brackets to your body parameter. So, "body[]" instead of just "body".
Reply all
Reply to author
Forward
0 new messages