I have set up various emails (Outlook and Gmail) with proper SMTP settings, yet database mail will not work.
The mail is stuck in the queue.
How do I get the mail to function?
Set up Outlook, then Gmail accounts to use, but neither worked.
I got this error:
"Date 2/22/2023 7:58:37 AM
Log Database Mail (Database Mail Log)Log ID 1057
Process ID 8752
Mail Item ID 19
Last Modified 2/22/2023 7:58:37 AM
Last Modified By saMessage
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2023-02-22T07:58:37).Exception Message:
Exception Type: Microsoft.SqlServer.Management.SqlIMail.MailFramework.Exceptions.BaseMailFrameworkException
Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at)
Data: System.Collections.ListDictionaryInternal
TargetSite: Void Send(Microsoft.SqlServer.Management.SqlIMail.MailFramework.Framework.IMessage)
HelpLink: NULL
Source: DatabaseMailProtocols
HResult: -2146232832StackTrace information
at Microsoft.SqlServer.Management.SqlIMail.MailFramework.Smtp.SmtpMailSender.Send(IMessage msg)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.ProfileMailSender.SendMailToAccount(Account a, IMessageSender ms, OutMailItem si)Exception information
Exception Type: System.Net.Mail.SmtpException
StatusCode: MustIssueStartTlsFirst
Message: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at
Data: System.Collections.ListDictionaryInternal
TargetSite: Void CheckResponse(System.Net.Mail.SmtpStatusCode, System.String)
HelpLink: NULL
Source: System
HResult: -2146233088StackTrace
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at Microsoft.SqlServer.Management.SqlIMail.MailFramework.Smtp.SmtpMailSender.Send(IMessage msg). )