node-imap
node-imap copied to clipboard
How to get uid of email ?
I have the following code I also want uid with seqno. is there is any way to do this ?
var f = self.imap.fetch(results, { bodies: '', markSeen: self.markSeen });
f.on('message', function(msg, seqno) {
var parser = new MailParser();
parser.on("end", function(mail) {
self.emit('mail',mail,seqno);
});
msg.on('body', function(stream, info) {
stream.pipe(parser);
});
});
Thanks in advance.
You can add:
msg.on('attributes', function(attrs) {
console.log('uid = ' + attrs.uid);
});
inside your 'message' event handler.
Thanks Man ! It worked