How can we help you today? How can we help you today?

GMail - Must issue a STARTTLS command first

I am getting a "5.7.0 Must issue a STARTTLS command first..." error message popping-up when trying to send a test email via GMail. Settings are:

SMTP host: smtp.gmail.com
Port: 587
UserName: <email address>
Password: <password for above>
Send From: <same as email address in UserName>

Thanks for any help.
sraitken
0

Comments

13 comments

  • petey
    SQL Backup's e-mail delivery feature does not support TLS/SSL connections.
    petey
    0
  • spthorn
    Is this still the case? v7.7.0.18

    Will it ever be the case? Our email is provided by Amazon SES, which requires it.
    spthorn
    0
  • petey
    There is a patch available that allows you to send mail via TLS and SSL. Details of the patch and required configuration can be found in this document:

    ftp://support.red-gate.com/patches/sql_ ... _patch.pdf
    petey
    0
  • spthorn
    Peter, I installed the patch files per your attached procedure. Still not getting emails.
    SMTP Host: email-smtp.us-east-1.amazonaws.com
    Results are the same regardless of SMTPEncoding value in registry (TLS, SSH or blank). Doesn't appear to be any change from before.
    I tried the following ports (based on http://docs.aws.amazon.com/ses/latest/D ... nnect.html):
    Port Result
    465 Screen freezes, after 20 seconds or so it comes back, but no email received
    2465 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."
    25 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."
    587 Get error "Must issue a STARTTLS command first"
    2587 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."

    I don't doubt that it works with Gmail and Yahoo mail. Nobody else is using Amazon SES (Simple Email Service) with SQL Backup Pro?
    spthorn
    0
  • petey
    Were you using the SQL Backup GUI to test the sending of emails?
    petey
    0
  • spthorn
    Yep, the Send Test Email button.
    spthorn
    0
  • petey
    Could you please try configuring the email server settings as per the document referenced earlier for GMail (TLS, port 587 etc), and run a test backup using SSMS that sends an email e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = &#91;&lt;AUTO&gt;&#93; WITH MAILTO = &#91;&lt;your email address here&gt;&#93;, MAILLIB_SYN"'
    

    Does the email get sent successfully?
    petey
    0
  • spthorn
    Yes, it did generate the email just fine.

    I went ahead and added email notification to one of my half-hourly transaction log backup jobs, just to see if that email would fail as well... and it did. Generated a SQL Backup warning "Warning 151: MAILTO error: Failed to send mail. (Must issue a STARTTLS command first)".
    spthorn
    0
  • petey
    In the job you modified, did you add the MAILLIB_SYN switch e.g.

    EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [me@me.com], MAILLIB_SYN"'
    petey
    0
  • spthorn
    Ok, Peter, I added that switch to the job via SSMS, and got the email generated as expected.

    However, when I attempt to edit the job in SQLBackup, I get the error "Cannot Edit Job <snip> Unknown option: MAILLIB_SYN".

    Overall, though, I'm happy I'm getting emails, and can deal with manual edits. Thanks so much for your help!
    spthorn
    0
  • petey
    Glad to hear you've got it working.

    The patch was made only in the SQL Backup engine. The GUI hasn't been patched to recognise the new keyword yet, hence why it's raising that error.
    petey
    0
  • petey
    An improved patch (7.7.0.103) is now available, details of which can be found in this document

    ftp://support.red-gate.com/patches/sql_ ... _patch.pdf

    In this patch, you no longer need to use the MAILLIB_SYN switch. This allows you to test the configuration of your SSL/TLS server via the GUI, and you also do not need to reconfigure existing jobs to use that switch, which in turn stops the GUI from raising an 'unrecognized option' error.
    petey
    0
  • spthorn
    Super, Peter. Works great! Thanks to the redgate team for this patch!
    spthorn
    0

Add comment

Please sign in to leave a comment.