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

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.
2 answers
Sort by: Most helpful
-
-
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.
- 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.
- 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.