NET SMTPClient 类
try
{
var smtp = new SmtpClient();
smtp.Send(message);
}
我收到以下异常
Message "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for doglin@gmail.com" string
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at MarilynDenisServices.Core.Services.EmailSender.SendEmail(IEmailModel model) in d:\dev\MarilynDenisServices\src\Core\Services\EmailSender.cs:line 42
我已经将 SMTP 设置放在 web.config 中。
<mailSettings>
<smtp deliveryMethod="Network">
<network host="192.168.16.200" />
<specifiedPickupDirectory pickupDirectoryLocation="C:\TEMP" />
</smtp>
</mailSettings>
ip是合法的。为什么我仍然收到此错误?有任何想法吗?请指教。
谢谢