简体   繁体   中英

How to render .msg file content in ASPX page?

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.

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());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM