Link to home
Start Free TrialLog in
Avatar of desiredforsome
desiredforsome

asked on

Display .eml file in browser

I am trying to pull binary from my sql which creates a .eml file which I can open in outlook no problem. I am looking to have it vieable within a browser some how.

Any suggesstions or free SDKs out there that will help with it.

Just need the .eml mime displayed in the web browser. If I could parse it I am sure it would be easier but having trouble parsing it as well.


Thanks,
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

I don't know (never looked for) free components to parse .eml.

But I am aware of this commercial product: http://www.aspose.com/.net/email-component.aspx 

But apparently, you can use CdoSys to parse them: http://support.microsoft.com/en-us/kb/310224
Avatar of TalokEchelon
TalokEchelon

From what I've found, an EML file is structurally equivalent to a MHT file.  You could output the file extension and MIME type of the document as MHT and it should display in a web browser.

The MIME type for both EML and MHT would be "message/rfc822".
Avatar of desiredforsome

ASKER

I found a library that is helping out but i am reaching an issue maybe you all could help.

I found a library called lumisoft and have good luck with alot of things however.

I am having trouble pulling the "To" or "From" I know im doing something wrong

This is in c#
 Mail_Message msg = Mail_Message.ParseFromFile(@"C:\Users\cgashlin.MORGANFINANCIA0\Desktop\{70FD9BE6-3B4E-4D07-BECA-C7F79A89C1E6}.eml");
            textBox2.Text = msg.Subject;
            //textBox3.Text = msg.BodyHtmlText;
            webBrowser1.DocumentText = msg.BodyHtmlText;
            textBox1.Text = msg.MessageID;

Open in new window


The above code works but i cannot do the following -

textBox1.Text=msg.To;

Open in new window


I get the following error and i cant figure it out -
Error      1      Cannot implicitly convert type 'LumiSoft.Net.Mail.Mail_t_AddressList' to 'string'
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Something simple lol.