none
SQL DBMail often fails

    Question

  • I have a SQL server where DBMail is enabled. One of the databases sometimes needs to send emails, sometimes more then one at the time, but it most of the time fails.
    The error is this:
    "Error,472,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2017-12-18T20:44:26). Exception Message: Cannot send mails to mail server. (A recipient must be specified.)"

    I have asked in the SQL forum for help
    "https://social.msdn.microsoft.com/Forums/sqlserver/en-US/7e6f0e29-b0ae-469d-94b1-13abec0eb17a/dbmail-some-mails-not-delivered?forum=sqltools"
    but they suggest it is a exchange server issue. How can I investigate it on the exchange server?

    Wednesday, January 3, 2018 6:59 PM

Answers

All replies

  • Hi,

    Based on your description, I know that you have configured SQL Database mail to send emails using Exchange 2013, and most of the messages cannot be delivered with the error above.

    For troubleshooting, please make sure you have allowed anonymous relay in Exchange 2013.

    We need to create a new received connector and configure the permissions for anonymous relay, for details, see:

    Allow anonymous relay on Exchange servers

    Hope it helps.

    Regards,

    Manu Meng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, January 4, 2018 7:03 AM
    Moderator
  • I have created anonymous relay for the sql server only. The funny, if something like this is funny, it is only some mail address that isen't send. If I change the email in the database the mail is delivered.
    Thursday, January 4, 2018 7:12 AM
  • Hi,

    Could you please describe "some mail addresses" in details? Is there generality for them in some aspects? 

    Regards,

    Manu Meng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, January 5, 2018 8:30 AM
    Moderator
  • Some mail addresses means some mail addresses. It is not all gmail addresses it wont send to. I have created a gmail to test with. There are also some other addresses like mail.dk it can and cannot send to. So there is no red thread in this issue. Also if I try to send an email with outlook to one of the addresses that fails, it is received.

    Need more details? Cant explain it better.

    Friday, January 5, 2018 12:46 PM
  • After reviewing some of the exchange transport protocols logs it turned out to be some hidden characters after the email addresses that caused the problem.
    Sunday, January 7, 2018 9:33 PM
  • Thanks for your sharing! 

    By the way, if you could get any help from the above posts, please be free to mark as answer, it will be helpful for others in this forum.

    Regards,

    Manu Meng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, January 8, 2018 1:53 AM
    Moderator