.net发送邮件

.net发送邮件 需引用 System.Net.Mail; public void SendEmail(string from,string to,string subject, string body) { MailMessage message = new MailMessage(from,to); message.Subject = subject; message.IsBodyHtml = true; message.Body = body; SmtpClient client = new SmtpClient("smtp.163.com"); client.Credentials = new NetworkCredential("ganty", "xjhdjnd"); client.Send(message); }
posted @ 2011-07-18 12:50  八神吻你  阅读(325)  评论(0编辑  收藏  举报