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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database Mail

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2013-01-14 : 11:44:13
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 = 'Troy.mail.com,
@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 74.125.133.109:25).

Vack
Aged Yak Warrior

530 Posts

Posted - 2013-01-14 : 11:59:17
I was able to figure this out. The profile name was changed from 'ETM Mail' to 'ETM'.
Go to Top of Page
   

- Advertisement -