WEB开发网
开发学院WEB开发ASP.NET .net2.0邮件发送代码 阅读

.net2.0邮件发送代码

 2006-12-18 17:19:48 来源:WEB开发网   
核心提示:System.Net.Mail.SmtpClient client = new SmtpClient(SmtpServer);client.UseDefaultCredentials = false;client.Credentials = new System.Net.NetworkCredential(UID, P

System.Net.Mail.SmtpClient client = new SmtpClient(SmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(UID, PWD);
client.DeliveryMethod = SmtpDeliveryMethod.Network;

System.Net.Mail.MailMessage message = new MailMessage(From,TO, Subject,Body);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);

Tags:net 邮件 发送

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接