从电子邮件正文中添加网页 [英] Add the web from in the body of the email

查看:206
本文介绍了从电子邮件正文中添加网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在提交用c#开发的时候拍摄网页的屏幕截图。



它需要贴在身上电子邮件不是pdf附件。



请帮帮我。



谢谢,
Sathish

I would like to take the screen shot of the web from when it is submitted "developed in c#".

And it needed to be attached i the body of the email not as a pdf attachment.

Please help me.

Thanks,
Sathish

推荐答案

由于C#在服务器上运行,因此您无法使用它来获取用户屏幕的屏幕截图。您可以使用JS并获取表单或整个html并包含它。



参见http://experiments.hertzen.com/jsfeedback/ [ ^ ]
Since C# runs on the server you can't use it to get a screen shot of the user's screen. You could just use JS and get the form or the whole html and include that.

See http://experiments.hertzen.com/jsfeedback/[^]


当表单提交到服务器时,您将获得所有字段值。

因此,您可以使用<$构建一个String c $ c> StringBuilder 获取所有字段值的类。您还可以在构建 String 时包含 HTML 标记,以便整个 String 将成为 HTML 字符串。



发送电子邮件时,指定或附加此 HTML 电子邮件的字符串正文属性,不要忘记设置 AllowHtml 属性为 true



如果你这样做,它将呈现正确。
When form is submitted to the Server, you get all the field values.
So, you can build a String with StringBuilder class taking all the field values. You can also include HTML tags while building the String, so that the whole String would become a HTML string.

While sending email, assign or append this HTML String to the email Body Property and don't forget to set AllowHtml property to true.

If you do this way, it will render the HTML inside the mail properly.


这篇关于从电子邮件正文中添加网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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