How to configure SMTP for sql managed Instance

Nagalaxmi V 21 Reputation points

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2021-02-16T08:00:07). Exception Message:

1) Exception Information

Exception Type: Microsoft.SqlServer.Management.SqlIMail.MailFramework.Exceptions.BaseMailFrameworkException
Message: Cannot send mails to mail server. (Transaction failed. The server response was: 5.7.1 Authentication required)
Data: System.Collections.ListDictionaryInternal
TargetSite: Void Send(Microsoft.SqlServer.Management.SqlIMail.MailFramework.Framework.IMessage)
HelpLink: NULL
Source: DatabaseMailProtocols
HResult: -2146232832

StackTrace 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)

2) Exception Information

Exception Type: System.Net.Mail.SmtpException
StatusCode: TransactionFailed
Message: Transaction failed. The server response was: 5.7.1 Authentication required
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean CheckResponse(System.Net.Mail.SmtpStatusCode, System.String)
HelpLink: NULL
Source: System
HResult: -2146233088

StackTrace Information

at System.Net.Mail.RecipientCommand.CheckResponse(SmtpStatusCode statusCode, String response)
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).

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. 4,296 Reputation points

    The error messages seems clear: The SMTP server requires authentication and it seems you didn't configured that in your database mail setting. I suggest that you talk to your SMTP people about the mail config to get the configuration for the mail profile right.

    0 comments No comments

0 additional answers

Sort by: Most helpful