vb.net 发送邮件(交易失败。服务器响应是:由于政策原因中继被拒绝)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13950883/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
sending mail(Transaction failed. The server response was: Relay rejected for policy reasons)
提问by nayef harb
I have a windows application that i am using to send emails. i can send an email for any
我有一个用于发送电子邮件的 Windows 应用程序。我可以给任何人发送电子邮件
one to his company mail directly (I am using domino server to send the mail)
一个直接给他公司的邮件(我是用domino服务器发邮件的)
for example i can send to [email protected]
例如我可以发送到 [email protected]
but when i send to [email protected] it is giving the following error
但是当我发送到 [email protected] 时,它给出了以下错误
Transaction failed. The server response was: Relay rejected for policy reasons.
交易失败。服务器响应是:由于策略原因中继被拒绝。
here is my code
这是我的代码
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress("[email protected]")
MyMailMessage.To.Add("[email protected]")
MyMailMessage.Subject = txtSubject.Text
MyMailMessage.Body = txtBody.Text
Dim SMTPServer As New SmtpClient("112.12.29.62")
SMTPServer.Port = 25
SMTPServer.Send(MyMailMessage)
回答by Per Henrik Lausten
Yes, it fails because the Domino server has been setup to not accept SMTP relays from unknown sources (to avoid spam).
是的,它失败是因为 Domino 服务器已设置为不接受来自未知来源的 SMTP 中继(以避免垃圾邮件)。
Contact the admin of the Domino server so that you can set up Domino to accept relay from machines running your application (if they can be uniquely identified), or from internal hosts (if that's the case), and/or combined with a SMTP account to login to SMTP.
联系 Domino 服务器的管理员,以便您可以将 Domino 设置为接受来自运行您的应用程序的机器(如果它们可以被唯一标识)或来自内部主机(如果是这种情况)和/或与 SMTP 帐户组合的中继登录到 SMTP。

