Database Mail SQL Server

Handian Sudianto 5,796 Reputation points
2025-02-10T12:04:56.92+00:00

Hello,

Anyone know why if we send mail from SQL Database mail i always git this error.

"The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2025-02-10T18:57:12). Exception Message: Cannot send mails to mail server. (Failure sending mail.). )975447"

Trying in some SQL server have same error, but if i manually test send mail from PowerShell in same server the email is working.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,492 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 46,291 Reputation points
    2025-02-10T14:08:28.4666667+00:00

    Check the SQL Server database mail configuration, if e.g. SMTP Server name is correct.

    See https://learn.microsoft.com/en-us/sql/relational-databases/database-mail/configure-database-mail?view=sql-server-ver16

    0 comments No comments

  2. ZoeHui-MSFT 41,291 Reputation points
    2025-02-11T01:38:41.9866667+00:00

    Hi @Handian Sudianto,

    From the error message, it seems the issue is related with the email server.

    Ensure that the Database Mail account (Account 1) is configured correctly.

    Check the SMTP server name, port number, and authentication settings.

    1. You may be able to increase your successful mail delivery rate by increasing the number of times Database Mail attempts to send each message. Start the Database Mail Configuration Wizard, and select the View or change system parameters option. Alternatively, you can associate more accounts to the profile so upon failover from the primary account, Database Mail uses the failover account to send e-mails.
    2. On the Configure System Parameters page, the default values of five times for the Account Retry Attempts and 60 seconds for the Account Retry Delay means that message delivery will fail if the SMTP server can't be reached in 5 minutes. Increase these parameters to lengthen the amount of time before message delivery fails.

    If these do not work, please check the error log to see if there are more details.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.