原码如下:
string from = "[email protected]";//发件人邮件地址
string userName = "13599999999";
string password = "123456";
string smtpHost = "smtp.139.com";
MailAddress _from = new MailAddress(from);
MailAddress _to = new MailAddress("[email protected]");
MailMessage message = new MailMessage(_from, _to);
message.Subject ="Test";
message.Body = "dddde";
SmtpClient client = new SmtpClient(smtpHost,25);
client.Credentials = new System.Net.NetworkCredential(userName, password);
client.Send(message);
执行完后,为什么在139邮箱没有收到邮件谢谢:)