简体   繁体   English

使用smtp客户端向多个收件人发送电子邮件时抛出异常

[英]Throwing Exception while sending Email to multiple recipients using smtp client

I have an application which uses SmtpClient to send an email. 我有一个使用SmtpClient发送电子邮件的应用程序。 I am trying to send an email to multiple recipients. 我正在尝试向多个收件人发送电子邮件。 I have two recipients in my to list eg "aman@gmail.com,abc@xyz.com". 我要列出两个收件人,例如“ aman @ gmail.com,abc @ xyz.com”。 and I am trying to send the email to this list but my application is throwing the exception as below: Client does not have permission to submit mail to this server. 并且我正在尝试将电子邮件发送到此列表,但是我的应用程序引发了如下异常: 客户端无权向该服务器提交邮件。 The server response was: 4.7.1 (abc@xyz.com): Relay access denied. 服务器响应为:4.7.1(abc@xyz.com):中继访问被拒绝。 because of this aman@gmail.com is also not able to receive the email. 因此,aman @ gmail.com也无法接收该电子邮件。 I need to implement the functionality that even there is an invalid address like abc@xyz.com in the ToList, an email should be sent successfully to aman@gmail.com. 我需要实现以下功能:即使ToList中存在诸如abc@xyz.com之类的无效地址,电子邮件也应成功发送到aman@gmail.com。 Can anybody please help me in this? 有人可以帮我吗?

Does this error message come from your own email server, or from that of xyz.com? 此错误消息是来自您自己的电子邮件服务器还是来自xyz.com? I'm guessing it's your own server, and that you either need to aunthenticate before sending, or use your own email address for sending (but the latter is kind of a long shot -- "we do not relay" means a server which is neither the sender's or the recipient's refuses to act as a middleman). 我猜它是您自己的服务器,您要么需要先取消身份验证,要么使用您自己的电子邮件地址进行发送(但是后者很长一段时间-“我们不中继”表示服务器是发送者或接收者都不拒绝充当中间人)。 It is also possible that the mail exchanger for xyz.com is misconfigured (either the MX record in DNS points to the wrong server, or the admin failed to configure it to accept this responsibility - technically basically the same thing) or that your client somehow ends up connecting to the wrong place. 也可能是xyz.com的邮件交换器配置错误(DNS中的MX记录指向错误的服务器,或者管理员未能将其配置为接受此职责-技术上基本上是同一件事)或您的客户端以某种方式最终连接到错误的地方。

(Not a proper answer but this got too long to fit in a comment.) (这不是一个正确的答案,但这太长了,无法放入评论中。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM