从电子邮件正文中添加网页 [英] Add the web from in the body of the email
本文介绍了从电子邮件正文中添加网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在提交用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 withStringBuilder
class taking all the field values. You can also includeHTML
tags while building theString
, so that the wholeString
would become aHTML
string.
While sending email, assign or append thisHTML
String to the emailBody
Property and don't forget to setAllowHtml
property totrue
.
If you do this way, it will render theHTML
inside the mail properly.
这篇关于从电子邮件正文中添加网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文