MailMessage m = new MailMessage();
m.From = "[email protected]";
m.To = "[email protected]";
m.Subject = "测试邮件";
m.Body = "测试邮件内容";
m.Priority = MailPriority.High;
m.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "smtp.163.com";
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"qcnet"); //set your username here
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"*******"); //set your password here
SmtpMail.Send(m);请问我换了smtp.163.com成其它的邮箱和服务器为什么不行?
其它服务器如:
smtp.yahoo.com.cn则出现 与服务器的传输连接失败。之类的错误!请大家帮帮忙啊,谢了!!
m.From = "[email protected]";
m.To = "[email protected]";
m.Subject = "测试邮件";
m.Body = "测试邮件内容";
m.Priority = MailPriority.High;
m.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "smtp.163.com";
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"qcnet"); //set your username here
m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"*******"); //set your password here
SmtpMail.Send(m);请问我换了smtp.163.com成其它的邮箱和服务器为什么不行?
其它服务器如:
smtp.yahoo.com.cn则出现 与服务器的传输连接失败。之类的错误!请大家帮帮忙啊,谢了!!
但这个帐号在yahoo上一般是无效的,就算有效,密码也是不对的,无法使用smtp.yahoo.com.cn发送信件,因为帐户就没有通过验证如果要使用smtp.yahoo.com.cn发送邮件,可以在yahoo上先注册一个账号,然后操作和使用smtp.163.com是一样的
smtp.yahoo.com.cn
smtp.qq.com
的服务器,邮箱,密码都不行.
"*******"); //set your password here
SmtpMail.Send(m); 在SmtpMail.Send(m); 这一句之前添加
SmtpMail.SmtpServer = "smtp.yahoo.com.cn";