Database Mail - 5.5.1 Authentication Required

  • I've searched the whole afternoon for what might be the cause of not being able to send emails with Database Mail.

    Here's what I did:

    - enabled Database Mail stored procedures in Surface Area Configuration

    - added a new Account

    (smtp.gmail.com, port 587, checked "required SSL", with username and password that I can log into gmail and can send email from with C#)

    - added a new Profile , associated it with that Account

    - added user to DataBaseMailUserRole role (had to add the role first, it did not exist.....? Don't know why)

    - tried to send test email...

    I had done exactly the same thing but with my company's SMTP server, and it worked...

    But I don't see why I would be able to send emails through gmail's SMTP in ASP.NET but not with Database Mail, with the same settings...

    The error I am getting is:

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2008-11-30T22:45:39). 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.

    I am out of ideas what I might be missing....

    Any help would be appreciated,

    Thanks

  • Sounds like a netwrok issue. Check with your network manager or your Mail Server manager.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Thanks for the reply...

    This is for a personal website though, from home...

  • What edition of SQL Server are you running?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Developer's edition, 2005...

    Does it make a difference??

  • Yeah, I don't think that Database Mail would work on Express Edition.

    Can you communicate with gmail SMTP through SMTP command line?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Thanks for replying.

    Yeah, that's true 🙂

    How do I try the SMTP command line?

    I can telnet the smtp.gmail.com:587.... and it works

    But can't send emails somehow.... and only from Database Mail...

  • Hmm, guess I forgot that SMTP command line is not built into Windows.

    Have you started SMTP services on your system?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • I have not installed SMTP services on my computer. Gmail's is a portable SMTP server....

    What I don't understand is that sending emails with the same account settings, but with C# code, works.

  • Install and start the MS SMTP Server. I beleive that it is free and part of XP SP3.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • amycanada (12/1/2008)


    I can telnet the smtp.gmail.com:587.... and it works

    But can't send emails somehow.... and only from Database Mail...

    Hmm, I thought that SMTP used port 25?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Also, check to make sure that there are not duplicate DBmail profiles:

    SELECT * From msdb.dbo.sysmail_profile

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • I think that if you use smtp.gmail.com, there's no need for local SMTP?

    http://forums.iis.net/t/1150572.aspx

    I guess what I'm trying to figure out is whether gmail is preventing users from spamming using it's smtp server......

  • OK then, execute the following commands and show us the results:

    select * from sysmail_account

    select * from sysmail_profile

    select * from sysmail_configuration

    select * from sysmail_server

    select * from sysmail_servertype

    Also, I need confirmation on the port number: What port is your GMail SMTP using?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Sorry for the formatting.....

    Here's the info... I am 99% sure there is nothing wrong with the settings...

    And yes, smtp.gmail.com uses port 587, non-standard port.

    account_id name description email_address display_name replyto_address last_mod_datetime last_mod_user

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

    1 AJ-Beads AJ-Beads gmail aj.beads.canada@gmail.com AJ Beads aj.beads.canada@gmail.com 2008-12-01 08:05:24.293 AMY-TOSHIBA\Amy

    (1 row(s) affected)

    profile_id name description last_mod_datetime last_mod_user

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

    2 AJ-Beads_profile for cell phone cases 2008-11-30 20:26:03.780 AMY-TOSHIBA\Amy

    (1 row(s) affected)

    paramname paramvalue description last_mod_datetime last_mod_user

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

    AccountRetryAttempts 1 Number of retry attempts for a mail server 2005-10-14 01:55:28.193 sa

    AccountRetryDelay 60 Delay between each retry attempt to mail server 2005-10-14 01:55:28.193 sa

    DatabaseMailExeMinimumLifeTime 600 Minimum process lifetime in seconds 2005-10-14 01:55:28.193 sa

    DefaultAttachmentEncoding MIME Default attachment encoding 2005-10-14 01:55:28.177 sa

    LoggingLevel 3 Database Mail logging level: normal - 1, extended - 2 (default), verbose - 3 2008-11-30 22:11:50.950 AMY-TOSHIBA\Amy

    MaxFileSize 1000000 Default maximum file size 2005-10-14 01:55:28.193 sa

    ProhibitedExtensions exe,dll,vbs,js Extensions not allowed in outgoing mails 2005-10-14 01:55:28.193 sa

    (7 row(s) affected)

    account_id servertype servername port username credential_id use_default_credentials enable_ssl flags last_mod_datetime last_mod_user

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

    1 SMTP smtp.gmail.com 587 aj.beads.canada@gmail.com 65536 0 1 0 2008-12-01 08:05:24.293 AMY-TOSHIBA\Amy

    (1 row(s) affected)

    servertype is_incoming is_outgoing last_mod_datetime last_mod_user

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

    SMTP 0 1 2005-10-14 01:55:32.850 sa

    (1 row(s) affected)

Viewing 15 posts - 1 through 15 (of 26 total)

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