How to make SQL Server Database Mail use "PLAIN" authentication (instead of "LOGIN" authentication)?



  • 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?



  • You are looking for Basic authentication:

    enter image description here

    But if the Database mail was working and suddenly stopped there is the chance that https://www.jeeja.biz/2021/07/01/sql-server-why-your-database-mail-is-not-working-and-probably-never-will/ .

    You don't need Wireshark to check the SMTP server delivery success, you can check that on the Database Mail Log.

    enter image description here




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2