SQL Server Mail Account Setup
Server name: smtp.gmail.com
Port number: 587
This server requires a secure connection (SSL): Checked
Basic Authentication: enter your username and password
Make sure “Allow less secure apps” is set to ON
Note: for Google Admin users go to Gmail -> Security -> Less Secure Apps
Run the following the the database server…
sp_CONFIGURE ‘show advanced’, 1 GO RECONFIGURE GO sp_configure ‘Database Mail XPs’,1 reconfigure GO ALTER DATABASE [MSDB] SET ENABLE_BROKER WITH NO_WAIT GO
You will get the following error if the “Allow less secure apps” setting is set to OFF.
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2020-11-18T11:23:49). Exception 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).