Setting up Database mail using gmail account


    SSC Guru

    Points: 281243

    tcnolan (4/6/2009)

    Mark Sumner (4/6/2009)

    tnolan (4/6/2009)

    Try this...

    Use for the server is the outbound from gmail smtp server. It will refuse your relay request.

    If that doesn't work, you could try installing IIS locally on your machine and run an SMTP server. Allow relay only for localhost and you should be able to use that for the server in database mail without an issue. Just make sure there isn't a firewall blocking the traffic outbound. It's an easy thing to try and it will probably work.

    This might work for an email address in the same domain, but to send to external domains iis smtp needs a smarthost (smtp relay) to relay email. I think it'll present the same problem as database mail. actually does work. I just tested this myself. The only difference is that I had to change the port to 587. see attachment. sent to two non-gmail accounts and a gmail account as a test.

    Thanks - this still works.

    Jason...AKA CirqueDeSQLeil
    I have given a name to my pain...MCM SQL Server, MVP
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • eclispe66

    Old Hand

    Points: 323

    Never works now. Thanks for the great posts.

    I tried the steps listed above and received the following error when I reviewed the log:

    01/22/2012 23:12:12,,Error,13,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2012-01-22T23:12:12). 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.5.1 Authentication Required. Learn more at ).

    Can anyone offer any assistance?

  • Welsh Corgi

    SSC Guru

    Points: 116520

    I tried this once with Yahoo and could not get it to work.

    For better, quicker answers on T-SQL questions, click on the following...

    For better answers on performance questions, click on the following...

  • srirampandian90

    SSC Journeyman

    Points: 77

    Due to security purpose gmail will block your account login through the SQL so you have allow the access for less secure login in gmail. I have tried and successfully sent a mail.:-)

  • Lindsay


    Points: 9

    Hello, I have read through your matter of concern and would like to help you in this regard. By following these steps you would probably be able to set up database mail utilizing Gmail account. It has been observed that Database Mail functions perfectly fine utilizing the Hotmail or Outlook SMTP server details. Though, an extra step is needed to get Gmail to work in the right way. You can also see more information about this on the Database Mail logs. Find out much more about setting up Gmail from . To avail this information just right-clicking on the Database Mail features and choose the option of "View Database Mail Log". You will see that Gmail advances a security flag the time when the Gmail SMTP server details are utilized for this purpose via automatic processing. You just have to enable the option that says "Allow less secure apps". This is a setting in your Gmail account that requires to be enabled. Once this Gmail setting is permitted, the Gmail SMTP server will work as estimated.

Viewing 5 posts - 46 through 50 (of 50 total)

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