How to configure SMTP for sql managed Instance

Nagalaxmi V 21 Reputation points
2021-02-16T09:11:38.307+00:00

Message
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. tibor_karaszi@hotmail.com 4,311 Reputation points
    2021-02-16T10:09:51.323+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.