Link to home
Start Free TrialLog in
Avatar of Member_2_7717371
Member_2_7717371

asked on

SQL Database Mail is failing in the middle of a procedure (or Agent job)

We are having an issue on our SQL server where jobs that send out a lot of emails send some emails but not all of the them.  In going through the logs the emails are sending fine and report 'Mail successfully sent' and then all of a sudden the error comes up with 'The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2017-09-18T12:16:43). Exception Message: Cannot send mails to mail server. (The operation has timed out.).).  It seems to fail at different intervals.

On the failure emails, the last_mod_user in the sysmail_event_log is 'sa' and the account_id is NULL.  However, on the successfully sent emails, the last_mod_user is 'DOMAIN\Administrator' and the account_id is 1.  It almost appears as if the Administrator looses connection and then the mail starts failing thereafter.

The same activity seems to happen regardless of running the proc manually or having the agent job initiate it.

The mail settings are (we use AuthSMTP.com to send):

Server Name: mail.authsmtp.com
Port: 2525
SSL: required
Basic Authentication with our AuthSMTP credentials.

Database Mail Executable Minimum Lifetime (seconds) = 600

Does anyone know why this would occur?  

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Russell Fox
Russell Fox
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_7717371
Member_2_7717371

ASKER

We were not hitting our limit as AuthSMTP had our limit set much higher and confirmed that we did not hit it.  However, they must have been blocking emails coming into them because we finally got frustrated and switched to sendgrid and have had no issues since - it definitely was not a SQL issue.  Thanks for the assistance.