Parsing .msg files in JavaScript

Does anyone know of any JavaScript libraries that will read / parse a Microsoft .msg file. I am writing a system that requires the viewer to send .msg files that have been saved on the server. I'll probably have to do .eml in the future too. I do not use .net or ASP framework. a project is just HTML / CSS / Javascript + JQuery.

I will need to extract only email addresses for recipients / sender, subject, attachments (file names are not actual files), body (text and html), date of sending, etc.

+6
source share
4 answers

The msg.reader library seems to do the job.

+2
source

You will need an MSG and / or EML converter library. I have used Mailbee.NET with success in the past, but Aspose or any other commercial library should work the same. Of course, you can always code your own MSG parser following the specifications , but won't you focus on your web solution?

Once you have the library, just wrap it in the front of the service and create AJAX requests in JS to extract the model data for display using the user interface. To handle these dynamic AJAX requests, you will need a page handler - node.js, ASPX, JSP, PHP, etc.

As a side note, it would be very inefficient to pull out the entire MSG for the client only to extract some of the metadata. Consider an MSG with 50 MB attachments - if you only need file names - the application will be useless / slow until it downloads all 50 MB. I donโ€™t think the browser (or users) will like it.

+1
source

You can also use Redemption and the RDOSession.GetMessageFromMsgFile method . It is available only in JavaScript (IE only), Java (via COM-bridge) and any .Net language.

+1
source

I believe that pure JS is not possible, but with node and linux on the server side we can .

It would be great if the nodemailer and / or msg.reader library could support HTML letters in msg format.

0
source

All Articles