将Asp.net页插入到Outlook电子邮件的正文中.

编程入门 行业动态 更新时间:2024-10-27 12:39:22
本文介绍了将Asp页插入到Outlook电子邮件的正文中.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好. 我的网页上有一个mailto:链接.按下此按钮后,我希望将网页内容显示在要发送的电子邮件正文中. 我已经阅读了有关覆盖渲染以捕获字符串中的网页html的内容,但是我需要知道如何将字符串插入电子邮件的正文中. 任何帮助表示赞赏. 代码如下:

Hello. I have a mailto: link on my webpage. When this is pressed I would like the contents of the webpage to be displayed in the body of the email to be sent. I have read about overriding render to capture the html of the webpage in a string but I need to know how to insert the string into the body of the email. Any help is appreciated. Code below:

string PageResult; protected override void Render(HtmlTextWriter writer) { // *** Write the HTML into this string builder StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter hWriter = new HtmlTextWriter(sw); base.Render(hWriter); // *** store to a string PageResult = sb.ToString(); // *** Write it back to the server writer.Write(PageResult); } protected void emailBody() { MailMessage mm = new MailMessage(); mm.IsBodyHtml = true; mm.Body = PageResult; }

<td> <asp:HyperLink ID="HyperLink1" A href="mailto:&Subject=Services Quote&body=" runat="server">Email Quote</asp:HyperLink> </td>

推荐答案

这只是一个猜测,我可能是错的,但是如果我想设置电子邮件的正文,则可以使用Body属性的MailMessage类. Its just a guess, I may be wrong, but if I wanted to set the body of an email I''d use the Body property of the MailMessage class.

更多推荐

将Asp.net页插入到Outlook电子邮件的正文中.

本文发布于:2023-11-09 03:07:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571229.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文中   电子邮件   Asp   net   Outlook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!