Not able to configure SQL Server database mail using TLS port 587 using Gmail. Gmail is blocking attempts with SSL port 465.

  • Hi, I am using SQL Server 2008 and configuring database mail using a Gmail account. Gmail is blocking attempts to login with the following message.

    "We strongly recommend that you use a secure app, like Gmail, to access your account. All apps made by Google meet these security standards. Using a less secure app, on the other hand, could leave your account vulnerable."

    I do not want to enable the option in Gmail to login with "less secure apps".

    In database mail profile, I checked the option "This server requires a secure connection(SSL)" and used it with TLS port 587 & SSL 465 but Gmail is still blocking it.

    If nothing works then the only option for me is to enable "less secure apps" in Gmail.

    Any help is appreciated.

    Thanks.

  • With "less secure apps" Google means legacy protocols such as SMTP, IMAP and POP3.

    There is no risk in enabling these protocols, at least no more risk than what you've had in the last 20 years.

    -- Gianluca Sartori

  • Thanks for the reply...

    I enabled the "less secure apps", but still it's not sending emails.. not able to figure out what's happening. I have tried through Microsoft Outlook and it's able to send test email.

    Have enabled the "Database Mail XPs"... and executed "reconfigure" also after that...

    I changed check and uncheck "requires SSL", give wrong password, change port from 465 to 25 to 587, different combinations but it continues to give same message as below...

    ------

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2016-04-28T16:03:08). Exception Message: Cannot send mails to mail server. (Failure sending mail.).

    ------

    No luck..

  • Is 2FA enabled on your Gmail inbox? That could be the cause.

    See this article: http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/setting-up-sql-server-database/ and some of the comments.

    -- Gianluca Sartori

  • Verified now. 2FA was off.

    Thanks for your time and effort... The script you referred to, worked like a charm...!!!!

    appears there is something seriously wrong with GUI on my machine, cause it's the same information which we all put in the "Database Mail Configuration Wizard" screen which was entered through the script you looked up for me...

    The only thing I am not able to find out right now is what the join, towards the bottom of the script, is doing.

    Appears that's making the difference between the database being able to send the mail or not.

    Thanks again for your help.

    I have removed the profile I created earlier and all the accounts that I created in that profile through GUI, but still SQL Server is looking for those accounts. Appears there is still some clean up left in the database mail tables which is not happening even after deleting the profile and accounts through GUI.

    Now, the log window is giving following message... though, the mail is going perfectly after running the script....

    -------------------------------------------------

    1) Exception Information

    ===================

    Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException

    Message: Could not retrieve item from the queue. Reason: the list of accounts which could send this mail is empty (probably due to the use of invalid profile).

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Controller.ICommand CreateSendMailCommand(Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DBSession)

    HelpLink: NULL

    Source: DatabaseMailEngine

    StackTrace Information

    ===================

    at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)

    at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)

    at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object o)

    -------------------------------------------------

    Appears the GUI is not correctly updating information in the database mail tables.... not sure though...

    Thanks

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply