1

I configured database mail profile as gmail smtp server, SSL and port 465. I didn't restart server. And this is first time to use Database Mail feature on that server.

When I send a testing mail it give me this error message:

The mail could not be sent to the recipients because of the mail server failure. (The operation has timed out)

I tried this mail configuration with Thunderbird and I could send messages througt this SMTP. Why is SQL Server giving this eror message? I searched here but didn't find any solution.

RedLEON
  • 281
  • 2
  • 7
  • 19

2 Answers2

1

First, have a look on SQL Server Database Mail log (Management -> SQL Server Logs -> Current, check Database Mail). It contains more detailed error explanation message.

However, most often the reason is in security configuration of Windows Server where SQL Server located. Look at firewall configuration on mail protocols and ports. To check if everything is good run your Thunderbird on the server where Database Mail profile is configured.

Serg
  • 2,346
  • 3
  • 29
  • 38
  • Thunderbird is working without error. But Database Mail is giving error. The database server managed another company. I look at the SQL Server Version and It seems old one. It need to be update latest service pack packages. After update lastest I will check it again. Thx @Serg – RedLEON Sep 05 '13 at 19:49
  • Did you run Thunderbirt on the server with database mail? If no this is incorrect experiment. – Serg Sep 05 '13 at 21:12
  • I did with same database mail smtp configuration. Thurderbird could send but sqlserver couldn't – RedLEON Sep 06 '13 at 07:44
  • No, I mean you should do it exactly on the same server computer. Possibly the reason is in security restrictions namely on your production environment. You can use any mail client available at this server - Outlook Express, etc. Only after successful sending email from the server you can say that something is wrong with database mail. To be concrete - even in such case you need to check from which account your SQL Server engine is running. – Serg Sep 06 '13 at 11:58
  • Sorry, read your comment one more time, maybe I misunderstood. Try to check authentication settings - TSL in mail client has another name in Database mail. – Serg Sep 06 '13 at 12:00
0

I am experiencing the same issue here. In my case, I am trying to send emails from my SQL Server instance using the SMTPS configuration (port 465 for the outbound connection) but it is not working. If I try with any any mail client is working perfectly.

Something that I noticed is that trying to connect via TELNET with port 465 is not possible (I guess I would need openssl instead)

For some reason, my hosting provider still allows me to connect using port 26 but If I try sending emails via telnet is telling me that my dynamic IP is blacklisted (that explains why database mail failed with port 26). Even if the IP address is blacklisted, connection via authenticated smpt is allowed. This means either my hosting provider is not able to accept connections with port 465 using database mail or there is something wrong with my sql server installation.

  • Fixed! I was able to fix the issue. Although my hosting provider usually indicated that port 465 is the one to be used for outbound smtps, by changing the port to 587 I was able to make it work. The issue happened because of the dynamic IP associated to my SQL server was blacklisted so I was no longer allowed to use unauthenticated STMP to send emails. – William Jul 31 '17 at 17:14