There have been two recent cases of sending exceptions to SQL Server Database Mail, and these questions are also somewhat interesting, by the way. It is convenient for people who encounter similar problems to be crazy about these problems! Provide a little more ideas.
Case 1: One of our database server suddenly send messages are not, when there is a problem, check the message sent records, you will find that the status of the send is failed.
SELECT from Msdb.dbo.sysmail_faileditems
SELECT from Msdb.dbo.sysmail_mailitems
Check the database Mail log and you will find the following error logs, as follows:
The message could not be sent to the recipient because of a mail server failure. (Use account 1 (2017-03-22t00:01:26) to send mail.) Exception message: The message could not be sent to the mail server. (The SMTP server requires a secure connection or the client is not authenticated.) The server response is: 5.7.1 Client is not authenticated). )
This problem occurs because the SMTP permissions on this server on the Exchange server do not know what is being canceled, causing the client to fail authentication when the database uses sp_send_dbmail to send mail. This can be resolved by adding SMTP permissions to the Exchange-seeking administrator.
Case 2: A database server that uses SQLBACKUPANDFTP backup also suddenly encounters a failed send message, and the test message is sent with a timeout prompt. This reason, the system administrator to help look for a long time, only to find that because of the server installed Symantec antivirus software, they on the server side opened the Internet Email auto-protect function. Causes Symante anti-virus software to intercept sqlbackupandftp software to send mail.
SQL Server Database Mail sending exception case