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.
@profile_name = 'ETM Mail',
@recipients = 'Troy.mail.com,
@query = 'select item_no, loc, qty_on_hand
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 220.127.116.11:25).