日期:2014-05-17 浏览次数:20534 次
protected void Page_Load(object sender, EventArgs e) { try { SmtpClient client = new SmtpClient(); client.DeliveryMethod = SmtpDeliveryMethod.Network; client.EnableSsl = false; client.Host = "smtp.126.com"; client.Port = 25; client.Credentials = new NetworkCredential("*******@126.com", "******"); MailMessage message = new MailMessage(); message.Priority = MailPriority.Normal; message.From = new MailAddress("********@126.com", null, Encoding.GetEncoding(936)); message.ReplyTo = new MailAddress("********@126.com", null, Encoding.GetEncoding(936)); message.To.Add("********@qq.com"); message.Subject = "zhuti"; message.SubjectEncoding = Encoding.GetEncoding(936); message.IsBodyHtml = true; message.BodyEncoding = Encoding.GetEncoding(936); message.Body = "<img src='http://www.baidu.com/img/baidu_logo.gif'>"; client.Send(message); } catch (Exception ex) { Response.Write(ex.Message); } }