I believe that the only way to read an Outlook .msg file (in order to extra metadata like subject, attachments etc), is to use the Outlook API - the Application.Session.OpenSharedItem()
method.
If this is the case, then I am looking for way to run this code on our application server, which doesn't have MS OFfice or MS Outlook installed. I'm getting the error
System.ArgumentException: progId not found. Outlook.Application
Which of course is due to the absence of the Outlook application.
Is there any way to install just a DLL or something in order to get the OpenSharedItem method to work? I don't want to have to install the full client if possible.
Or, is there a way to parse a .msg file without requiring significant dependencies such as Outlook?
This was answered in a codeplex article I have saved from a long time ago
Article is here, there is a file called OutlookStorage.cs that does not require the outlook model.
As in the comments below there is now a nuget package that covers this:
here
Props to Simon Green in the comments for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With