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
相关文档:
前前后后收到过一些学生的来信,询问ASP.NET的学习顺序问题,在此就向打算系统学习ASP.NET技术的初学者谈谈我的建议。
如果你已经有较多的面向对象开发经验,跳过以下这两步:
第一步 掌握一门.NET面向对象语言,C#或VB.NET。
我强烈反对在没系统学过一门面向对象(OO) ......
Asp.net页面中调用以SOAP头作验证的web services操作步骤:
第一步:用来作SOAP验证的类必须从SoapHeader类派生,类中Public的属性将出现在自动产生XML节点中,即:
<soap:Header>
<UserSoapHeader xmlns="http://tempuri.org/">
<UserName>strin ......
/// <summary>
/// 写Cookies
/// </summary>
/// <param name="response"></param>
/// <param name="request"></param>
&n ......
Javascript 在ASP.net 母板页下访问 控件ID:
对于 html control : 直接访问ID
document.getElementById("hfRespondID");
对于 Web control :
document.getElementById("<%= this.hfRespondID.ClientID %>") [注意大小写
]
&nb ......
public bool SaveExcel(GridView paramGridView)
{
if (paramGridView.Rows.Count == 0)
{
return false;
}
//创建Excel对象
Microsoft.Office.Interop.Excel.Application myExcel = new Microsoft.Office.Interop.Excel.Appl ......