I'm having issues sending Database Mail with "PLAIN" authentication on two different versions MSSQL Server.
- SQL Server 2012
- SQL Server 2019
Context
I have created backup jobs which regularly backup some databases to files and report success or errors via email.
I have managed to configure Database Mail to send out the respective messages, and confirmed via Wireshark and by studying the logs of the SMTP server that the emails are getting to the SMTP server.
Problem
However, I have a problem which is a show stopper. A user must log in into the SMTP server before the latter accepts the user's messages. Database Mail indeed tries to log in with the correct credentials, but uses LOGIN authentication, while the SMTP server only accepts PLAIN authentication.
That is, when establishing the communication, Database Mail at some point issues AUTH LOGIN ... when it should issue AUTH PLAIN .... Subsequently, it sends the credentials in the wrong form. Therefore, it is currently impossible to let Database Mail send messages using the SMTP server in question.
How can I make Database Mail use PLAIN authentication?

