通过电子邮件发送网页内容... [英] Emailing contents of a webpage...

查看:232
本文介绍了通过电子邮件发送网页内容...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经在asp.net页面上创建了一个打开电子邮件客户端的链接.然后,我希望将该页面或页面元素添加到电子邮件正文中.调试PageResult变量下面的代码可以正确呈现html.我想知道是否有可能以某种方式使用也在下面发布的mailto代码中的PageResult变量,特别是在语句的主体部分中.

干杯

A

Hi there,

I''ve created a link on an asp.net page that opens an email client. I would then like the page, or elements of the page to be appended to the body of the email. Debugging the code below the PageResult variable renders the html correctly. I wonder if it is possible to somehow use the PageResult variable in the mailto code also posted below, specifically in the body part of the statement.

Cheers

A

        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

            string PageResult = sb.ToString();



            // *** Write it back to the server

            writer.Write(PageResult);

}





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

            </td>


推荐答案

最可能要做的是,如果可以在页面外访问该内容,则通过电子邮件发送该内容. .但是,如果覆盖页面的Render方法,则可以捕获页面的HTML,并将其用于电子邮件.
The most likely thing to do, is to email the content you are rendering, if you can access that content outside the page. However, if you override the Render method of a page, you can capture the HTML of the page, and use that for your email.


这篇关于通过电子邮件发送网页内容...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆