我已经仔细阅读了以下问题的答案,发现它非常有帮助。但是,关于 smtp 服务器的行为,我有一个不同的问题。 Mailbox unavailable 和 Relay configuration
场景: 我有两个我无权访问的 smtp 服务器,即只有凭据。从 1 个服务器发送电子邮件时,我收到以下错误:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay
Type: System.Net.Mail.SmtpFailedRecipientException:
Source:System
Stack Trace: at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message)
非常清楚,即 smtp 服务器无法中继消息。然而,在其他服务器上,SendEmail 方法没有抛出任何异常,但我收到一封 Mailer Daemon 电子邮件消息,指出:
This is the mail system at host test.relay.host.name.changed.
I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can delete your own text from the attached returned message.
The mail system
test1.test2@hotmail.com: host mx3.hotmail.com[xx.xx.xx.xxx] said: 550 Requested action not taken: mailbox unavailable (in reply to RCPT TO command)
问题:
- 为什么会有不同的行为?即在一种情况下我收到邮件 守护进程消息而在其他 SendEmail 方法中出现异常?
此外,
- 具体来说,邮件守护程序消息是如何工作的?因为根据 第二条消息似乎是中继发送的。
- 如果这是配置差异,那么它们是什么?
最佳答案
5.7.1 无法转发 - 这意味着邮件被发送到不同域中的用户并且邮件服务器无法“转发”它(基本上,它无法将它发送到另一个域
第二个错误“邮箱不可用”——这意味着Server已经确定该域属于Server并且已经确定没有邮箱
所以,在第一种情况下,它看起来是不同的域,而在第二种情况下,它是相同的域。
关于c# - 服务器响应为 : 5. 7.1 无法中继/邮件守护程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43988961/