具体代码:
MailAddress from = new MailAddress("23456789@qq.com");
MailAddress to = new MailAddress("12345678@qq.com");
MailMessage mm = new MailMessage(from, to);
mm.Subject = "Title";
mm.IsBodyHtml = true;
mm.Body = "value";
SmtpClient client = new SmtpClient("smtp.qq.com");
client.Credentials = new NetworkCredential("abc", "****");
try
{
client.Send(mm);
Console.Write("发送成功");
}
catch (System.Net.Mail.SmtpException ex)
{
}
Console.Read();
我把邮箱,邮箱密码,邮箱用户名改了