javascripteml

How to create an in memory eml file with JavaScript?


How can I create a client side in-memory eml file? I've come across numerous suggestions. But none, out of the box, work in my setup. Namely where

Some of the technics I've investigated but discounted so far

https://www.npmjs.com/package/eml-format

https://github.com/BramEsposito/eml-to-pdf

Depend on the 'fs' module which browserify complains about

https://www.example-code.com/nodejs/email_examine_eml.asp

Licenced

https://github.com/nodemailer/mailparser

Looked promising but specific to reading existing emails not creating them.

https://www.npmjs.com/package/mime https://www.npmjs.com/package/mime-types

Is not used to create eml files.

https://github.com/ikr0m/mime-js

Looks promising but I've yet to get it to work.


Solution

  • Settled upon the emailjs-mime-builder

    https://github.com/emailjs/emailjs-mime-builder