Eml parser ... parse mail into subject, body text, html, attachments, etc

Hi there,

has anybody successfully build a workflow which takes in a (binary) eml file and converts the different objects into a json objects? And if so, wants to share this.

Thanks in advance and best regards - Dick

Hi @dickhoning, is there a chance you can use the IMAP Email node to fetch emails instead of parsing eml files? This would seem like the simplest approach to me.

As for parsing eml files, this would require custom code. You could try running something like MQpeng/eml-parse-js: format EML file in browser env (github.com) in the Function node, but I haven’t done this myself so wouldn’t be able to provide any pointers here unfortunately.

@MutedJam Hi Tom, I will take a look at the IMAP Email node and thanks for the tip on iml-parse-js. I already looked at Mailparser :: Nodemailer myself and I was hoping some of my fellow n8n coders could help me with a working example. Cheers

1 Like

This definitely seems like an interesting case. Maybe someone has actually approached this before in n8n, let’s see :slight_smile:

BTW: the IMAP Email does exactly what I want as far as parsing is concerned. Now, instead of fetching the mail messages via an IMAP account, I’m looking for an option to feed the raw text of an email message into this node …