jolly
jolly

Reputation: 137

Throwing Exception while sending Email to multiple recipients using smtp client

I have an application which uses SmtpClient to send an email. I am trying to send an email to multiple recipients. I have two recipients in my to list e.g "[email protected],[email protected]". 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 ([email protected]): Relay access denied. because of this [email protected] is also not able to receive the email. I need to implement the functionality that even there is an invalid address like [email protected] in the ToList, an email should be sent successfully to [email protected]. Can anybody please help me in this?

Upvotes: 1

Views: 3554

Answers (1)

tripleee
tripleee

Reputation: 189297

Does this error message come from your own email server, or from that of 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.

(Not a proper answer but this got too long to fit in a comment.)

Upvotes: 3

Related Questions