2012-09-29 31 views
1

它工作正常的特定電子郵件地址發送電子郵件,但郵件的其餘部分不works..following錯誤顯示出來:不能從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); 

回答

0

將您的代碼更改爲以下代碼:

client.Port = 465; 

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