Click here to Skip to main content
15,350,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I am sending mails through SQL SendMail Jobs relayed through SMTP server.
Recipients are in "To" as well as "CC".
However, the SQL server is capturing the status as "Sent" for the invalid domain names as well.

1. If the domain names are invalid SQL should capture it as "Not Sent"/"Unsuccessful"/"Undelivered"
2. If a mail is not sent to specific recipient in "To" or "CC" it should capture the email ID to whom the email is not sent.

Is there any way to check whether the emails are successfully sent and delivered to the recipient for valid domains ONLY? and marks other as Undelivered in SQL

Thanks in advance.

What I have tried:

Could not find any alternative except different queries to check the data captured in SQL
Updated 15-Apr-21 22:53pm

1 solution

For invalid domains, you would only get a delivery failure if SQL Server was sending email directly. Since it's configured to send via your SMTP server, all it can know is that your SMTP server has accepted the message for delivery. At some later point, the SMTP server will attempt to deliver the message and fail, but it has no way of reporting that failure back to SQL Server. Instead, the sending email account will receive a delivery status notification message with the error details.

For valid domains, you have no way of knowing whether the recipient is valid, or has actually received the message. Almost all domains are configured to not report invalid recipients, since this could be used to enumerate valid recipients. And almost all mail clients are configured not to send read/received receipts, since this could be used by spammers to confirm that the address is valid.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900