Database Mail (can't connect to SMTP server)

I'm new to Database Mail and SQL 2005. I have an existing SMTP server (not local) which I'm able to connect to and send mail using Outlook. When I try to connect to the same SMTP serverin Database Mail, I get the following error in the Log:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2006-09-20T17:04:21). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

No matter what variation I try, I can't connect to the server. I also tried setting up a local SMTP server (the one that comes with IIS). I was able to send mail out successfully from Outlook using this local SMTP server too. However, I get the same error when trying the local server in Database Mail.

This is probably something stupid I'm missing. Any ideas?

I'm using SQL 2005 Developer Edition to test applications on Windows XP Pro.

Thanks,

James

September 20th, 2006 9:36pm

We are experiencing the same issue, same error message but onSQL 2005 Enterprise Edition- (Database Mail).

Thanks,

Carmen

Free Windows Admin Tool Kit Click here and download it now
October 27th, 2006 8:51pm

Same here ... i checked the error from

SELECT * FROM msdb.dbo.sysmail_event_log

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2006-11-15T06:58:44). Exception Message: Could not connect to mail server. (No such host is known). )

But i know my Host is right .

Thanks

Praveen

November 15th, 2006 3:15pm

I had same problem using dbmail on my laptop, but I have figured out what was wrong. The anti-virus program is blocking any port 25 message out, so my dbmail cannot reach my mail server. I have another dbmail on a sql server in the same network segment as the mail server is can send mail without problem. Check with your network admin to see if anything is blocking port 25 message (anti-virus, firewall etc.). By the way, Outlook uses MAPI API to talk to Exchange Server.

Good luck.

Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2006 1:30pm

I know this was postedlast year, but I looked all over and couldn't find the answer.

Just in case someone else comes behind me looking for some help ...

Here is what I did to resolve it:

1.make sure your port is open by telnet - at dos prompt: telnet <servername> 25

If it works, then your error is not a problem with the smtp server.

2. make sure no one else has attempted to set up a default profile:

SELECT * FROM msdb.dbo.sysmail_profile

In my case the DBA prior to me had set up a bad profile, which never worked.I deleted it. VOILA!

December 26th, 2007 8:46pm

try out this link

Script For Setting Database Mail and Sending Email From SQL Server 2008

Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2010 9:36pm

Mohammed,

Your link was not there but there is one that is adequate here:

http://www.snapdba.com/2013/04/enabling-and-configuring-database-mail-in-sql-server-using-t-sql/

July 17th, 2015 3:26pm

Make sure  you have created a db profile  to send the mail and your port is open to send mail
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 6:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics