C# 发送邮件代码
C# 发送邮件代码
1 MailMessage mailMsg = new MailMessage(); //using System.Net; 引用 2 mailMsg.From = new MailAddress("lcfhn168@163.com", "lichunfang");//发件邮箱 3 mailMsg.To.Add(new MailAddress("459928575@qq.com", "lichunfang"));//收件邮箱 4 mailMsg.Subject = "Hello ..."; //主题 5 mailMsg.Body = "ni hao ,,,,,";//.内容 6 SmtpClient client = new SmtpClient("smtp.163.com"); //smtp.126.com smtp.qq.com 7 client.Credentials = new NetworkCredential("lcfhn168", "");//用户名,密码 8 client.Send(mailMsg);
转载 请注明原文地址并标明转载:http://www.cnblogs.com/laopo
商业用途请与我联系:lcfhn168@163.com