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

latestTo() has undefined html and text when email contains attachments

Open mtbvang opened this issue 4 years ago • 3 comments

When a message is retrieved with latestTo that contains attachments the text and html properties are undefined. Removing the attachments from the messages results in the properties being set and retrievable.

mtbvang avatar Jan 02 '21 22:01 mtbvang

I use search(from, 'from') and get the same

speker2010 avatar Feb 24 '21 10:02 speker2010

I found library https://nodemailer.com/extras/mailparser/

for example

let emails = await mailhog.search(from, 'from');
let parsedEmail = await simpleParser(emails.items[0].Raw.Data);

//parsedEmail.html 
//parsedEmail.attachments[0].filename

speker2010 avatar Feb 24 '21 12:02 speker2010

Unfortunately I could not reproduce this yet. A reproducible test case or a pull request would be welcome!

blueimp avatar Sep 25 '21 02:09 blueimp