I have spent the last couple of days searching everywhere on the internet and have not managed to find a solution or a proper explanation of my issue. since a couple of weeks ago without and update on our Microsoft SQL Server the DB_Mail has just stopped working and is reporting the below error in the log.

Date 2019-08-07 02:24:50 PM Log Database Mail (Database Mail Log)

Log ID 4924 Process ID 260668 Mail Item ID 3098 Last Modified 2019-08-07 02:24:50 PM Last Modified By sa

Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2019-08-07T14:24:50). Exception Message: Could not connect to mail server. (A system call has failed 10.x.x.x:25). )

What I have Tried

  1. I Have tried using the exact configuration in the DB_Mail Profile to send mails from Powershell and .Net and this works 100%
  2. Create a new Profile using the GUI
  3. Create a new profile using the Setup Script included in the installation "C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql\Database Mail"
  4. Tried to replace db mail with Darko Martinović's CLR solution, but get a base64 error link
  5. Open DatabaseMail.exe to see if I get any errors as describe in some articals, but seem to work find. Also replaced DatabaseMail.exe with that of another server in the same environment that does work, but this still does not work "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\DatabaseMail.exe"

Additional Information

Windows Server 2016 Standard

Microsoft SQL Server 2017 (14.0.3076.1)

  • 1
    The error says it cannot connect to port 25 on the SMTP server. This is likely not specifically a problem with DB Mail. Even if mail works from other tools like PowerShell and .NET, I strongly suspect the SMTP server is blocking the connection. I'd try and see if there's a different port to try, like 465, 587, 993, or something else (which in turn may require an SSL connection). – Randolph West Aug 10 at 18:50
  • Have you tried doing telnet from the DB server to the SMTP server on port 25 and see if there is any blocking or it goes successfully? – Learning_DBAdmin Sep 3 at 12:11

Disable TLS1.0 and TLS1.1 and check It will work.

  • Welcome to DBA.SE! You could improve this answer by providing some basic instructions to perform what you're suggesting. Doing so would likely warrant a few upvotes. Welcome to the community! – John Eisbrener Sep 3 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.