简体   繁体   English

如何在WebBrowser控件中打开.eml文件?

[英]How to open .eml files in the WebBrowser control?

I'd like to ask here, how can I open a .eml file, located in the file system, in a WebBrowser control. 我想在这里问,如何在WebBrowser控件中打开位于文件系统中的.eml文件。 Here's what I've at this moment: 这是我目前的状态:

string uri = Convert.ToString(myDataReader["Uri"]); //obtained the URI from a database query a few lines of code earlier


FileInfo file = new FileInfo(uri);
OpenPop.Mime.Message mensagem = OpenPop.Mime.Message.Load(file);

origem = mensagem.Headers.From.ToString(); //origin of the email
destino = mensagem.Headers.To.ToString(); //destiny
assunto = mensagem.Headers.Subject.ToString(); //subject
conteudo = mensagem.MessagePart.Body; //message body

I'm using OpenPop.Net to get the messages from the POP3 server in another form, and I need to know how to get the HTML part of those messages... 我正在使用OpenPop.Net以另一种形式从POP3服务器获取消息,我需要知道如何获取这些消息的HTML部分...

Thanks in advance! 提前致谢!

João Borrego 若昂·博雷戈

Have you checked out the examples for OpenPop.Net ? 您是否查看过OpenPop.Net示例 Specifically you should check out the "Find specific parts of an email (text, html, xml)" example . 具体来说,您应该查看“查找电子邮件的特定部分(文本,html,xml)”示例

There is a introduction to how email works on the website as well. 网站上也介绍了电子邮件的工作方式。 This might be helpful in understanding how OpenPop.Net is built since it evolves around how emails are structured internally. 这可能有助于理解OpenPop.Net的构建方式,因为它围绕内部电子邮件的结构演变而来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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