If you’re trying to send email using Database Mail in SQL Server, but it fails to send, you can check the sysmail_event_log
view to see why it failed.
The sysmail_event_log
view returns one row for each Windows or SQL Server message returned by the Database Mail system. By “message”, I don’t mean the actual mail message. I mean a message such as the error message that explains why the mail failed.
You can also use the sysmail_configure_sp
stored procedure to determine what types of messages are logged.