SmtpFailedRecipientException

时间:2011-05-26 15:38:48

标签: web-services

我已将其部署在服务器上。但是我注意到它仍然在寻找我当地的道路..任何人都知道这个问题吗?

此处服务器上的错误:

System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for margarrete@yahoo.com
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at EmailWebservices.EmailAcess.Send() in C:\Users\Desktop\proj\Mail\Mail\EmailAcess.cs:line 52 //path on my local is this a error?
   at EmailWebservices.Service1.SendMessage(String Mail, String AuthSTR) in C:\Users\Desktop\proj\Mail\Mail\Service1.asmx.cs:line 36 //path on my local is this a error?

谢谢!

1 个答案:

答案 0 :(得分:2)

你误解了这个错误 stacktrace中的文件名是来自PDB文件的原始源文件的路径。
它与服务器上编译的DLL无关。

实际问题是您没有为SMTP服务器SmtpClient.Credential = new NetworkCredential(...)提供登录,因此它拒绝发送外部邮件。