asp.net 发送邮件
web.config:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="chunyou128<you@163.com>">
<network host="smtp.163.com" />
</smtp>
</mailSettings>
</system.net>
C#
try
{
MailAddress from = new MailAddress("mymail@163.com");
MailAddress to = new MailAddress("mymail@163.com");
MailMessage message = new MailMessage(from, to);
message.Subject = "Test Message";//发送邮件的标题
message.Body = "yuanyouchun";//发送邮件的内容
//if (FileUpload1.PostedFile.FileName != "")
//{//发送附件
// Attachment att = new Attachment(FileUpload1.PostedFile.FileName);
// message.Attachments.Add(att);
//}
SmtpClient client = new SmtpClient("smtp.163.com");
client.UseDefaultCredentials
相关文档:
1.打开新的窗口并传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attributes.Add("onclick","return ......
需求:
A域有页面a.html,其中有iframe包含B域的页面b.html,现在要通过a.html上的一个按钮,来把a.html页面上一个文本框的值传递到b.html页面的文本框。
注:这里b.html是html网页,不能接收其他网站post过来的值,所以不能用直接post的方法来传值,但是,如果接收页面是b.aspx或者b.asp 呢,那不是可以直接post了么?答 ......
Javascript 在ASP.net 母板页下访问 控件ID:
对于 html control : 直接访问ID
document.getElementById("hfRespondID");
对于 Web control :
document.getElementById("<%= this.hfRespondID.ClientID %>") [注意大小写
]
&nb ......
对Web应用程序来说,发生不可预知的错误和异常在所难免,我们必须为Web程序提供错误处理机制。当错误发生时,我们必须做好两件事情:一是将错误信息记录日志,发邮件通知网站维护人员,方便技术人员对错误进行跟踪处理;
二是以友好的方式提示最终用户页面发生了错误,而不能将未处理的错误信息显示给用户。
&nbs ......