繁体   English   中英

无法从asp.net发送电子邮件

[英]cannot send email from asp.net

它适用于特定的电子邮件地址,但其余电子邮件无效。.出现以下错误:

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);

将代码更改为以下代码:

client.Port = 465;

client.Host = " smtp.mail.yahoo.com";
client.EnableSsl = true;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM