The server response was: 5.5.1 Authentication Required. (The SMTP server requires a secure connection or the client was not authenticated. Exception Message: Cannot send mails to mail server. (Sending Mail using Account 5 (T00:18:27). These logs have all sorts of useful information that could help in troubleshooting, and we are in particular interested in the ‘description’ column as it holds detailed information about the error and what went wrong.Ģ error 00:18:27.800 The mail could not be sent to the recipients because of the mail server failure. The statement will return logs and in a case like ours when e-mails are not delivered look for the errors under the ‘event_type’ column: To enable Database Mail, run the following code: This doesn’t mean we cannot use it because it’s only not available as an interface, but it’s still available in the SQL Server Database Engine itself. Since Microsoft SQL Server 2016 Express edition is used in this article as an example, the Management node does not have Database Mail: Then expand the Management node and double-click Database Mail or right-click and choose Configure Database Mail to open the Database Mail Configuration Wizard: Usually, all we need to do is go in Object Explorer, connect to the SQL Server instance we want to configure Database Mail on and expand the server tree. Using Configuration Wizard is easier, but bear in mind that Database Mail is turned off in SQL Server Express editions. To create a Database Mail profile, we can use either the Database Mail Configuration Wizard or T-SQL code. In order to complete this successfully, we need to: The process of Database Mail configuration has three main steps. Using Database Mail, database applications can send e-mail messages that can, for example, contain query results or simply alert a user about an event that occurred in the database. Database Mail, as you would expect from its name, is a solution for sending e-mail messages from the SQL Server Database Engine to users.