node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Getting message body with MIME info.

Open pkgodara opened this issue 9 years ago • 2 comments

I'm getting 'TEXT' specified message body which is starting with This is a multi-part message in MIME format.\r\n--------------7E1BE875BC1326AE502AAEC4\r\nContent-Type: text/plain; charset=utf-8; format=flowed\r\nContent-Transfer-Encoding: 7bit\r\n\rEMAIL CONTENT .

I don't want this additional info. I need body to start right from 'EMAIL CONTENT'.

How do I do that?

pkgodara avatar Jun 20 '17 09:06 pkgodara

You need to fetch the message's structure (pass struct: true when calling fetch() on the message). There are examples of message structure objects in the readme. The structure will give you a partID, which you can use by itself or as a prefix for the specific type of information you're looking for (e.g. '1.TEXT') when supplying what bodies to fetch().

mscdex avatar Jun 20 '17 15:06 mscdex

Thanks. That worked.

pkgodara avatar Jun 22 '17 08:06 pkgodara