blueimp / mailhog-node

A NodeJS library to interact with the MailHog API. MailHog is a stand-in SMTP server for Web and API based SMTP testing.
MIT License
35 stars 10 forks source link

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

Open mtbvang opened 3 years ago

mtbvang commented 3 years ago

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.

speker2010 commented 3 years ago

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

speker2010 commented 3 years ago

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
blueimp commented 3 years ago

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