它适用于特定的电子邮件地址,但其余的电子邮件不起作用。以下错误显示:
Server Error in '/RealTimeArsenicDataVisualizer' Application.
Mailbox name not allowed. The server response was: From address not verified - see http://help.yahoo.com/l/us/yahoo/mail/original/manage/sendfrom-07.html
我的代码:
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtp.mail.yahoo.co.in", 587);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(emailid, password);
client.Port = 587;
client.Host = "smtp.mail.yahoo.co.in";
client.EnableSsl = false;
object userstate = msg;
client.Send(msg);
答案 0 :(得分:0)
将您的代码更改为:
client.Port = 465;
client.Host = " smtp.mail.yahoo.com";
client.EnableSsl = true;