【问题标题】:SMTP Client ExceptionSMTP 客户端异常
【发布时间】:2013-07-04 21:02:47
【问题描述】:

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 是合法的。为什么我仍然收到此错误?有任何想法吗?请指教。

谢谢

【问题讨论】:

    标签: .net smtp smtpclient


    【解决方案1】:

    这似乎更像是与安全或权限相关的错误,因为当请求来自不受信任的资源时,SMTP 不会发送电子邮件。

    请联系 SMTP 管理员并提供身份验证(可能是用户 ID 和密码)以连接到 SMTP 服务器。这将解决问题,服务器将能够按预期发送电子邮件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-27
      • 2010-12-10
      • 2015-08-18
      相关资源
      最近更新 更多