0

I have some e-mails that i would like to store in SQL Server database and render within an asp.net web application.
Currently the .msg files are stored in a BLOB field and and a link to download the file to user's system is given.
However, I want to render the content of the message directly without giving the user any options to download it. The messages are in HTML format with embedded images.
All suggestions are welcome.

Anurag
  • 348
  • 2
  • 15
  • As far as I understand it should just be a MIME type, look here it may help: [link](http://stackoverflow.com/questions/1669797/are-there-net-framework-methods-to-parse-an-email-mime) – David Esteves Jan 11 '12 at 17:32

1 Answers1

0

You need parse MIME. You can find classes for it on the next page: http://www.codeproject.com/KB/IP/ReceivingMail.aspx

You can load mail body to the MailItem:

Pop3Lib.MailItem m = new Pop3Lib.MailItem("mail body here");
Pop3Lib.MailItem m = new Pop3Lib.MailItem(System.IO.File.ReadAllText("C:\\mymail.msg"));
Response.Write(m.GetText());
Aleksey Nemiro
  • 86
  • 1
  • 1
  • 3