简体   繁体   English

从带有 HTML 正文的 ASP.NET 页面中获得预可视化的邮件

[英]Having a mail in previsualization from an ASP.NET page with HTML body

I would like that a button click on an ASP.NET page opens a new mail with the default mail client, filled with an HTML content.我希望在 ASP.NET 页面上单击按钮会打开一封带有默认邮件客户端的新邮件,其中填充了 HTML 内容。

I tried SmtpClient, but it doesn't show the mail, it sends it directly.我试过 SmtpClient,但它不显示邮件,它直接发送。

I tried Outlook interop, but I have the expected result only in debug, when I deploy the code server side I have the following message : "Retrieving the COM class factory for component with CLSID failed due to the following error: 80070005 Access is denied" (I installed Outlook both serverside and clientside).我尝试了 Outlook 互操作,但我只在调试中得到了预期的结果,当我部署代码服务器端时,我收到以下消息:“由于以下错误,检索具有 CLSID 的组件的 COM 类工厂失败:80070005 访问被拒绝” (我在服务器端和客户端都安装了 Outlook)。

And finally I tried .Process() with System.Diagnostics.最后我用 System.Diagnostics 尝试了 .Process()。 This shows the mail before sending it, this fills it with a text, but I need the body to be formatted in HTML.这会在发送邮件之前显示邮件,并用文本填充它,但我需要将正文设置为 HTML 格式。

Anyone could help please ?有人可以帮忙吗?

Thank you,谢谢,

I have the begining of a clue with SmtpClient, it consist on writing an eml file that has its body formatted in html.我从 SmtpClient 开始有一个线索,它包括编写一个 eml 文件,该文件的正文格式为 html。 I could open it after and do a "forward" on it.我可以在之后打开它并对其进行“转发”。

How to save MailMessage object to disk as *.eml or *.msg file 如何将 MailMessage 对象作为 *.eml 或 *.msg 文件保存到磁盘

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

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