Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database Mail
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

530 Posts

Posted - 01/14/2013 :  11:44:13  Show Profile  Reply with Quote
I have setup database mail on a SQL server 2008 R2 machine. I setup the following job last year and it ran fine all year up until 12/7/2012.

EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'ETM Mail',
    @recipients = ',
    @query = 'select item_no, loc, qty_on_hand
              from [001].dbo.iminvloc_sql
              where qty_on_hand < 0' ,
    @subject = 'Negative Invenotry',
    @attach_query_result_as_file = 1 ,
    @query_attachment_filename = 'NegativeInventory.txt';

I can send a test email fine. I receive it within a few seconds.
But if I try to send an email using EXEC msdb.dbo.sp_send_dbmail I eventually get the following message.

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2013-01-14T11:40:04). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Edited by - Vack on 01/14/2013 11:59:46

Aged Yak Warrior

530 Posts

Posted - 01/14/2013 :  11:59:17  Show Profile  Reply with Quote
I was able to figure this out. The profile name was changed from 'ETM Mail' to 'ETM'.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000