河北三个石头  

protected void Button1_Click(object sender, EventArgs e)
{
//网易163邮箱
try
{
for (int i = 1; i <= 100; i++)
{
SendSMTPEMail("smtp.163.com", "tianl82092578@163.com", "tl611999", "82092578@qq.com", "标题", "<p><a href='http://www.baidu.com'>xxxx</a></p>");
}
}
catch (Exception)
{

throw;
}

}
public void SendSMTPEMail(string strSmtpServer, string strFrom,string strFromPass, string strto, string strSubject, string strBody)
{
System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(strFrom, strFromPass);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new MailMessage(strFrom, strto, strSubject, strBody);

message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
}

posted on 2013-06-08 20:36  河北三个石头  阅读(134)  评论(0编辑  收藏  举报