Gmail SMTP Plugin for WordPress

Last updated on by admin

Gmail SMTP is an advanced SMTP mailing plugin for WordPress for sending email via Gmail SMTP server. Unlike most SMTP plugins It uses the OAuth 2.0 protocol to authorize access to the Gmail API instead of password authentication.

Gmail SMTP Benefits

1. Gmail SMTP plugin does not store your password. It uses the OAuth 2.0 mechanism for SMTP authentication. It means a more secure login system for users.

2. Gmail SMTP plugin uses PHPMailer – a very popular PHP library used in the core WordPress for sending email. This is to make sure that users can still get full benefits of the default mail functionality.

3. Gmail SMTP plugin takes big headache away from you because you no longer need to Allow Less Secure Apps on your gmail account. This is an option that users had to enable in order to fix SMTP connection issue. This issue went viral from December 2014, when Google started imposing OAuth 2.0 authentication to access their apps. This option affects SMTP mailing because applications that perform password authentication to IMAP, POP, or SMTP are considered Less Secure Apps.

As far as I know this issue still affects almost all the SMTP plugins out there.

How OAuth 2.0 Authorization Works

1. You register a web application in the Google Developers Console.

2. When this application is launched it requests that you give it access to data in your Google account.

3. If you consent, the application receives credentials to access the API.

Requirements

  1. PHP 5.4 or later
  2. A Gmail Account
  3. A self-hosted WordPress site

Gmail SMTP Plugin Summary

Plugin Name: Gmail SMTP
Icon of Gmail SMTP
Description: Connect to Gmail SMTP server to automatically send email from your WordPress site. Configure wp_mail() to use SMTP with OAuth 2.0 authentication.
Rating: 4.1 based on 45 reviews
Price: 0 USD
Availability: instock

Installation

You can install the Gmail SMTP plugin in one of the following ways:

Option 1 (Quick & Easy install)

  1. Go to Plugins->Add New from your WordPress admin dashboard
  2. Search for Gmail SMTP
  3. Click Install once you have found it

Option 2 (Manual install)

  1. Download the zip version of the plugin
  2. Go to Plugins->Add New
  3. Click Upload Plugin
  4. Select the zip file on your computer
  5. Install it

Gmail SMTP Configuration

In order to get started with the plugin go to Settings->Gmail SMTP from your admin dashboard.

screenshot of gmail smtp plugin menu

1. Go to console.developers.google.com.

2. Login to your Google account which will be used to send email.

3. Create a new project where your application will be registered.

screenshot showing how to create a new project in the Google Developers Console

It doesn’t have to be “Gmail SMTP Project 1”. You can name it whatever you like. I chose a meaningful name because I have multiple projects in it.

4. Once the project is created Click on the ENABLE API button.

screenshot showing how to enable an API on a project in Google Developers Console

If you have multiple projects make sure that the right project is selected in the drop down menu.

5. Select Gmail API under “G Suite APIs”.

screenshot showing how to select Gmail API for a project in Google Developers Console

6. This will show you more information as to what you can do by enabling Gmail API. Click Enable.

screenshot showing how to enable Gmail API on a project in Google Developers Console

7. Now that you have enabled this API you need to create credentials to use it. So go to the Credentials tab.

screenshot showing how to create credentials for Gmail API in Google Developers Console

8. Select OAuth Client ID when you are creating these credentials.

screenshot showing how to create OAuth Client ID for an API in Google Developers Console

9. In order to create an OAuth client ID you need to set a product name first. So click Configure consent screen.

screenshot showing how to configure the consent screen when creating an OAuth Client ID

10. Enter a product name (e.g. Gmail SMTP) and a privacy policy page URL for the OAuth consent screen and click Save.

screenshot showing the oauth consent screen in the google developers console

11. Now that the OAuth consent screen has been configured you can create an OAuth Client ID. Set the application type to Web application and enter a name for it (e.g. Gmail SMTP App).

12. Copy the Authorized Redirect URL from the settings and paste it into the field here.

screenshot showing how to create a client id by creating a new web app in the google developers console

13. Click Create. This will generate a Client ID and Client Secret for you. Copy and paste them into the settings area of the plugin.

14. Configure the rest of the settings. It includes,

OAuth Email Address: The email address that you will use for SMTP authentication. This should be the same email used in the Google Developers Console.

From Email Address: The email address which will be used as the From Address when sending an email.

From Name: The name which will be used as the From Name when sending an email.

Type of Encryption: The encryption which will be used when sending an email (either TLS/SSL). By default it should be set to TLS since SSL has been deprecated since 1998.

SMTP Port: The port which will be used when sending an email. If you choose TLS it should be set to 587. For SSL use port 465 instead.

15. Click Save Changes.

Now that you have configured the settings a Grant Permission button will appear.

screenshot showing how to grant permission from the gmail smtp settings

16. Clicking on it will take you to a consent screen where you will be able to grant this app access to the Gmail API.

allow application screen of google developers console

17. When you click Allow you will get redirected back to the plugin settings. You should see a message like Access Granted Successfully. The SMTP Status should also get set from Not Connected to Connected.

screenshot of gmail smtp settings

That’s it. Gmail SMTP plugin will now be able to take control of all outgoing email from your website.

Test Email

In order to test the email functionality you can send a test email from the Test Email tab.

Debug option is enabled by default for the test email functionality – which means you would be able to see if the plugin was able to send the email without any error.

screenshot showing how to send a test email from the gmail smtp plugin settings

Troubleshooting

By default, your SMTP port should be configured on 587 (with TLS encryption). If you can’t get it to work then you can try changing it to 465 (with SSL encryption).

If you still can’t get either to work try port 25 with TLS first and then SSL. Please note that most servers don’t support encryption on port 25, which is why port 587 and 465 are the preferred options.

smtp connect() failed

If you are connecting to the Gmail SMTP server for the first, you might get an error: smtp connect() failed or Could not authenticate.

This error usually occurs when Gmail blocks a SMTP connection made from an external server. This is not a configuration issue. Gmail does it time to time for security reasons. In order to fix this issue login to your Gmail account first. You should see a security warning from Gmail upon login – “Your account has been hacked” or “Somebody stole your password”. As soon as you confirm that it was you who tried to login (Just click on the link that shows up in that message), the plugin should be able to connect to the Gmail SMTP server.

Error Invalid Scope

Google recently enhanced their risk assessment for new web applications that request user data. Based on this risk assessment, some web applications will require a manual review before users can approve data permissions. Until the review is complete, unverified apps will display an “invalid_scope” or some other random error messages when you go to the permissions consent page.

If you are getting this type of error when setting up the plugin you can join this Google group Risky Access Permissions By Unreviewed Apps. This will automatically approve data access to the app from your account and you won’t have to go through their manual review process (which includes filling out a developer verification form). This automatic approval process is permissible by Google for testing/personal use/sending email through WordPress Plugins/similar single-account smtp usage (See this page for more details).

Error refreshing the OAuth2 token

This is an intermittent issue that seems to occur on some servers. When you get this error, it means that the plugin is not being able to refresh the OAuth2 token using the secret access key. It is required by the App that you created in your account to access the Gmail API. Usually the issue goes away when you delete the existing secret access key from the database and do a fresh authorization. For details please check the “Fresh Authorization” section.

OpenSSL Certificate Verification Failure

As of PHP 5.6 you will get the following error/warning if the SSL certificate on the server is not properly configured:

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

In order to fix this issue your web host needs to replace this invalid, misconfigured or self-signed certificate with a good one. The other alternative is to check this option in the settings so PHP doesn’t verify the certificate – “Disable SSL Certificate Verification”. That said, I wouldn’t recommend it since this change was made for a good reason.

Fresh Authorization / Removing Access From the Application

For some reason if you ever want to stop using this plugin or do a fresh authorization this option might come in handy.

Revoke Access menu allows you to remove access from a previously authorized application.

screenshot showing the revoke access settings of gmail smtp plugin

First, you need to click on the account settings link. This will take you to a page where you can remove access from the Gmail SMTP application.

screenshot showing how to remove access from an application in the google developers console

Once you have removed access from it, go back to the Remove Access tab in the plugin settings and delete the Access key.

Access key is a token received by the plugin when you first granted your app access to the Gmail API. This token is needed to communicate with the Gmail API and send email. In order to avoid any confusion the plugin does not show it on the settings page.

Once this token is deleted the plugin can no longer connect to the Gmail SMTP server or send email. This means you will need to reauthorize (using the web application link in the settings) before you can start using the plugin again. However, you won’t need to set up everything from scratch as long as the project still exists in your Google Developers Console.

If you have any questions feel free to share it in the comment section.

If you like Gmail SMTP please leave it a rating. A huge thanks in advance!
Users who like this plugin also like SiteGround.

207 thoughts on “Gmail SMTP Plugin for WordPress”

  1. Hi,
    I’ve followed all the intructions and I’m getting the following error bellow. Any ideas? Tried every combinations of ports and encriptions with no success.

    Thanks

    SERVER -> CLIENT: 220 2.0.0 Ready to start TLS

    Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/storage/9/08/35/agenciagdm/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php on line 343
    SMTP Error: Could not connect to SMTP host.
    CLIENT -> SERVER: QUIT
    SMTP -> get_lines(): $data is ""
    Connection: closed
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    1. @Ricardo, It looks like there is an issue in your SSL configuration.

      https://github.com/PHPMailer/PHPMailer/issues/368

      I can add a tweak in the plugin so it doesn’t verify the certificate. But I think you should try to get your hosting to fix the certificate (PHP 5.6 made this change for a good reason).

      1. I have released an update to address this issue. You can now disable SSL certificate verification in the settings, If you are unable to get your host to fix SSL configuration on the server.

  2. Hi, i’ve followed all the instructions and have this error

    SMTP Error: Could not authenticate.
    CLIENT -> SERVER: QUIT
    SMTP -> get_lines(): $data is ""
    SMTP -> get_lines(): $str is "221 host.t2tagency.com closing connection"
    SERVER -> CLIENT: 221 host.t2tagency.com closing connection
    Connection: closed
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    It’s a problem with the server?

      1. Same error as above:

        SMTP Error: Could not authenticate.

        No email in the auth email inbox. Tried revoking and deleting the auth. No luck.

        Please advice

        1. @Elliotr, Please contact your host to make sure port 587 is open and supports TLS encryption. Please also copy and paste content from the “Server Info” tab so I can take a look.

  3. Really great plugin! I already have it running on a couple of client sites.

    Im encountering one annoying thing though – I can’t seem to change the “From Email Address” – everytime I receive an email the from email is always the defined “OAuth Email Address”.
    It seems that the defined “From Email Address” is ignored.

    Note: The email I have defined in “From Email Address” is a custom@clientdomain.com = not a gmail/google domain, not sure if that has anything to say?

    When sending the test email I see the correct “From Email Address”, however when I receive the email and reply to it, then it shows the “OAuth Email Address”.

    Anyone experienced the same issue?

    TEST EMAIL SNIPPET:
    CLIENT -> SERVER: Date: Wed, 11 May 2016 22:08:31 +0000
    CLIENT -> SERVER: To: my@email.com
    CLIENT -> SERVER: From: Company
    CLIENT -> SERVER: Subject: Test mail

    1. ok the EMAIL SNIPPET didn’t print out well in the comment 🙂 Eitherways, bottomline is that I see the right “From Email Address” in the test email log

    2. There is a solution. You must go to your account settings in gmail> accounts and import> Send email as:> Add another email address

      Follow the procedures to add custom@clientdomain.com

      Once added, will work custom@clientdomain.com defined in “From Email Address” in the plugin’s settings.

  4. Hi,

    I am facing an unusual problem in that the configuration seems fine and the test email response doesn’t mention any errors, but none of the test emails are actually reaching their destinations. Here are some more details about my setup:

    Google: Using Google Apps for Business. Have set up OAuth as suggested and the Gmail SMTP settings shows a green checkmark.

    Domain: Domain is on Godaddy. MX records were set by Google Apps for Business automatically when I had signed up with them for email. I am unable to find any settings on Godaddy where I can change MX settings to “remote”, so that is one of the few steps from previous comments that I could not properly follow.

    Hosting: Hosting is on Digital Ocean.

    On trying to send Test Email, this is what I get:

    Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
    Connection: opened
    SMTP -> get_lines(): $data is ""
    SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP q19sm6609949qhb.20 - gsmtp"
    SERVER -> CLIENT: 220 smtp.gmail.com ESMTP q19sm6609949qhb.20 - gsmtp
    CLIENT -> SERVER: EHLO allonzy.in
    SMTP -> get_lines(): $data is ""
    SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [162.243.2.17]"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]"
    SMTP -> get_lines(): $str is "250-SIZE 35882577"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577"
    SMTP -> get_lines(): $str is "250-8BITMIME"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME"
    SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
    SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES"
    SMTP -> get_lines(): $str is "250-PIPELINING"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING"
    SMTP -> get_lines(): $str is "250-CHUNKING"
    SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING"
    SMTP -> get_lines(): $str is "250 SMTPUTF8"
    SERVER -> CLIENT: 250-smtp.gmail.com at your service, [162.243.2.17]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
    Auth method requested: XOAUTH2
    Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH

    My Server Details:

    OS: Linux ubuntu-512mb-nyc2-01 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
    PHP version: 5.5.9-1ubuntu4.14
    WordPress version: 4.5.1
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Enabled
    stream_socket_client: Available
    fsockopen: Available

    Any idea on how to troubleshoot this? I am at a dead-end. I have no other mail plugins setup.

    1. I sorted it out! 🙂

      On checking the apache2 error logs, found that curl_inti() was not being found. Basically, curl was not installed on the server. Installed php5-curl, restarted server and the test email went through.

      Thanks for the awesome plugin! 😀

    2. Same problem here, but it was working before.

      I have no ssh access to the server. Is there any other solution rather than installing php5-curl?

    3. I sorted it out.
      The website admin had changed the password and the authentication token became invalid.
      Did a fresh authentication and it’s working fine again 🙂

  5. Hi Admin,

    I’m having problem in grant permission. I keep getting HTTP ERROR 500: MySite is currently unable to handle this request. Where it cannot redirect after I click ALLOW
    My Server:

    OS: Windows NT NSTPNIE 5.2 build 3790 (Windows Server 2003 R2 Standard Edition Service Pack 2) i586
    PHP version: 5.4.31
    WordPress version: 4.5.2
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Enabled
    stream_socket_client: Available
    fsockopen: Available

    1. @Hardy, I can’t really troubleshoot this since I’m not logged into your gmail account. If it’s an issue on the developers console you should probably try it again later.

      1. Ok, do you what this error mean:

        Fatal error: Uncaught exception 'Google_IO_Exception' with message 'Failed to connect to accounts.google.com port 443: Timed out' in X:\XXX\XXX\wp-content\plugins\gmail-smtp\google-api-php-client\src\Google\IO\Curl.php:115 Stack trace: #0 X:\XXX\XXX\wp-content\plugins\gmail-smtp\google-api-php-client\src\Google\IO\Abstract.php(136): Google_IO_Curl->executeRequest(Object(Google_Http_Request)) #1 X:\XXX\XXX\wp-content\plugins\gmail-smtp\google-api-php-client\src\Google\Auth\OAuth2.php(111): Google_IO_Abstract->makeRequest(Object(Google_Http_Request)) #2 X:\XXX\XXX\wp-content\plugins\gmail-smtp\google-api-php-client\src\Google\Client.php(128): Google_Auth_OAuth2->authenticate('4/VcjFJ9yZzCgPx...', false) #3 X:\XXX\XXX\wp-content\plugins\gmail-smtp\class.phpmaileroauthgoogle.php(99): Google_Client->authenticate('4/VcjFJ9yZzCgPx...') #4 X:\XXX\XXX\wp-content\plugins\gmail-smtp\main.php(132): GmailXOAuth2::resetCredentials('4/VcjFJ9yZzCgPx...') #5 [internal function]: GMAIL_SMTP->plugin in X:\XXX\XXX\wp-content\plugins\gmail-smtp\google-api-php-client\src\Google\IO\Curl.php on line 115

        1. @Hardy, I’m not sure what this error means either. I did some research with the error message. Some users are saying it’s a firewall issue on the server.

  6. Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
    SMTP ERROR: Failed to connect to server: Connection refused (111)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    OS: Linux n1plcpnl0005.prod.ams1.secureserver.net 2.6.32-673.8.1.lve1.4.3.el6.x86_64 #1 SMP Wed Feb 10 08:57:30 EST 2016 x86_64
    PHP version: 5.4.43
    WordPress version: 4.5.2
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Enabled
    stream_socket_client: Available
    fsockopen: Available

    I am using google apps gmail. Tell me whats going on please. 🙂

  7. I get the following error:

    “400. That’s an error.

    Error: invalid_request

    Missing required parameter: client_id”

  8. I love this plugin very much, but just wondering about one eFatal error: Uncaught Google_Auth_Exception: Error refreshing the OAuth2 token, message: ‘{ “error” : “invalid_grant” }’ in /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Auth/OAuth2.php:363 Stack trace: #0 /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Auth/OAuth2.php(276): Google_Auth_OAuth2->refreshTokenRequest(Array) #1 /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Client.php(457): Google_Auth_OAuth2->refreshToken(‘1/2ME6Ob2yBVkie…’) #2 /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/class.phpmaileroauthgoogle.php(142): Google_Client->refreshToken(‘1/2ME6Ob2yBVkie…’) #3 /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php(471): GmailXOAuth2->getOauth64() #4 /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/class.phpmaileroauth.php(152): SMTP->authenticate(”, ”, ‘XOAUTH2’, ”, ”, Object(GmailXOAuth2)) #5 /home/ediblyco/public_html/wp-cont in /home/ediblyco/public_html/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Auth/OAuth2.php on line 363rror for authorization.

    This is error causing by this plugin.. so could you please help me for this issue?
    Thanks

    1. @Lowell, Please do the steps outlined in the “Fresh Authorization” section and see how it goes. Can you copy and paste the content from your “Server Info” tab?

  9. I did all the set up again but I’m getting this message now

    401. That’s an error.

    Error: deleted_client

    The OAuth client was deleted.

    Request Details
    response_type=code
    redirect_uri=https://roynuesca.com/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant
    client_id=188060277206-j9l99p8um19mi0411hkrfuvuhmmaj1ig.apps.googleusercontent.com
    scope=https://mail.google.com/
    access_type=offline
    approval_prompt=auto

    1. @Roy, Did you delete the app from your account? If so and you created a new app, please update the client ID and Client Secret in the settings.

      1. I went to the app section in my account and It wasn’t there. So I created a new app and updated everything but still nothing 🙁 I tried multiple times, and everytime I click grant permission, I get that error

        401. That’s an error.

        Error: deleted_client

        The OAuth client was deleted.

        Request Details
        response_type=code
        redirect_uri=https://roynuesca.com/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant
        client_id=188060277206-j9l99p8um19mi0411hkrfuvuhmmaj1ig.apps.googleusercontent.com
        scope=https://mail.google.com/
        access_type=offline
        approval_prompt=auto

  10. Hi, I followed all the steps, even update the wordpress version to 4.7.2. I have a problem when I redirect to the gmail permissions page I authorize and it goes to a blank page and it stays in that page without doing anything. Thank you

  11. Hi, first of all thanks for your great plugin.
    We have encountered the following error when doing some tasks like user creation, user password change, cloning site with ns cloner plugin. Trying to do those things lead to a blank page and leaves tasks half done.

    PHP Fatal error: Cannot declare class PHPMailer, because the name is already in use in /var/www/html/wp-includes/class-phpmailer.php on line …

    We are running 4.7.2, coming from earlier versions which I don’t remember having any of the above mentioned issues.
    Any idea why this is happening now? Thank you.

    1. @Eneko, Thank you for your kind words. For some reason I don’t see any error on my development site when I update a user. So this may have something to do with the plugin that you are using. Does it use the PHPMailer library?

      1. Is there an easy way I can check if any of the plugins uses PHPMailer library?
        I tried deactivating NS Cloner and leaving your plugin active and it fails.
        Deactivating GMAIL SMTP plugins makes wordpress work without issues, including the tasks mentioned above.

  12. Information required to set up API on Google is incomplete.

    Maybe the google side has been changed as there are specific questions asked that there are no guidelines for on this page.

  13. Simple to set up, although did need a bit of head scratching because the documentation is no longer entirely correct after Google changed the way the Developer API works, and moved things around.

    A bit more of a concern to me though, is that the client ID and Secret are left in plain view on the settings page.

    Doesn’t this mean that if someone unauthorised gains access to the Admin, they can abuse those?

  14. Hi there

    I was really optimistic when I came across this plugin. It really seems like it should work. But for now, for me, it isn’t. Even after reading the troubleshooting. The following is the error message, can you suggest a solution:

    Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable)
    SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    SMTP connect() failed.

    I don’t know why gmail would be unreachable. It’s google for goodness sake. Anyway, any expert help that can solve this problem would be much appreciated

    David

    1. @David, Google server is not the issue here. The plugin is running on the web server you are using. And in order to send the email it needs to first make a connection to the gmail server. This type of issue usually occurs when the port in use is blocked by your hosting provider. Please contact them to make sure that port 587 and 465 are not blocked.

      1. @admin, I know that 587 is not open but I verified using an online tool that 465 is open. I was trying to use the 465 port with SSL.

        I can check with the host that there is nothing else I need to know. But if there are any other common reasons for the error I was getting I would appreciate knowing.

        Thanks and kind regards

        David

        1. @David, Gmail recommends TLS on port 587 (SSL is a bit older). So it would be better if they could keep that open.

  15. Hi,

    I cannot use this plugin with the same gmail address and google web application on different WordPress installations. It only works where first activated.
    However, “Grant access” workd and SMTP Status is “Connected”, but when trying to send Test email it sais “Username and Password not accepted”.

    Tony

  16. I thought this might be the solution to my problems…

    But when sending a test email, it hands for about 6 minutes with no error message except a timeout.

    I’m unsure how to fix it!

  17. Plugin works perfectly, but doesn’t work for lost password, it outputs.
    “The email could not be sent.
    Possible reason: your host may have disabled the mail() function.”

    1. @Jacon, Password reset feature seems to be working fine for me. You may have a plugin that is causing this issue?

  18. I have done all of the troubleshooting on this page for my gmail smtp but I am still getting this error.

    Connection: opening to smtp.gmail.com:465, timeout=300, options=array ()
    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:465 (Connection refused)
    SMTP ERROR: Failed to connect to server: Connection refused (111)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    1. @Anthony, Please use port 587 instead. If it still doesn’t work contact your host to make sure port 587 is open and supports TLS encryption.

        1. @Anthony, If you ask GoDaddy they will say everything is fine on their end (you can try though). They actually have their own SMTP. So you may not be able to use your own SMTP on a GoDaddy server.

          1. They said I would need a programmer to tweak the plugin to make it work. Is there anything you can do

  19. Could you help me troubleshoot, please?

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network is unreachable)
    SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Gmail whitelisted to 587.

      1. The host defaults 587 to closed, but has whitelisted smtp.gmail.com
        Just waiting on confirmation of TLS encryption support.

  20. I have set the plugin up successfully (I have the screen button and am authorized) but am not clear on how to actually send an email from WordPress. I would like to do so programmatically. I’m a skilled programmer so all I need is a code snippet or link to a page explaining the steps.

    1. @Brian, There is a test email option in the plugin that you can use to send a test email. Other than that, emails will usually be sent by a contact form plugin on your site or WordPress. The plugin’s job is to use the Gmail SMTP server to send an email instead of your server. This happens automatically in the backend when the wp_mail function is called by a plugin.

  21. Does not work at all on Godaddy Managed WordPress sites – they block port 587, 465. Check the ‘Godaddy’ section here: https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    One more strike against them…

  22. Need help to Troubleshoot – mail not sending

    I have tried the available troubleshooting steps mentioned above that pertain to my problem but it still persists.

    I am receiving this error after I successfully setup the SMTP with google developer console.

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network is unreachable)
    SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    I am hosted with Bluehost and I spoke with them and have verified ports 587 & 465 are open and my server uses TLS encryption.

    Here is my server info:
    OS: Linux box1111.bluehost.com 3.12.65-20161020.132.ELK6.x86_64 #1 SMP Thu Oct 20 23:36:20 CDT 2016 x86_64
    PHP version: 5.6.29
    WordPress version: 4.7.4
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Enabled
    stream_socket_client: Available
    fsockopen: Available
    cURL: Available
    cURL Version: 7.24.0, OpenSSL/1.0.0

    Any help you can steer my way is greatly appreciated! Thanks.

  23. Hello, do you have any ideas why emails sent to outlook or hotmail are failing fraud test? Some contents are blocked such as images. Though emails are delivered to inbox but there is always a warning.
    Thanks

  24. Have used plugin before successfully. Am running into issues.
    Am hosted on a VPS configuration. Server info yields:
    OS: Linux vm361.tmdcloud.com 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64
    PHP version: 5.6.30
    WordPress version: 4.7.4
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Disabled
    stream_socket_client: Available
    fsockopen: Available
    cURL: Available
    cURL Version: 7.53.1, OpenSSL/1.0.1e

    Test email fails despite everything seeming to be properly configured. Key parts of debug trace:

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
    Connection: opened
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “220-vm361.tmdcloud.com ESMTP Exim 4.89 #1 Fri, 12 May 2017 15:32:49 +0000 ”
    …and it fails with:
    SERVER -> CLIENT: 250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250 HELP
    Auth method requested: XOAUTH2
    Auth methods available on the server: PLAIN,LOGIN
    SMTP Error: Could not authenticate.
    CLIENT -> SERVER: QUIT
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “221 vm361.tmdcloud.com closing connection”
    SERVER -> CLIENT: 221 vm361.tmdcloud.com closing connection
    Connection: closed
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    1. @Gia, The log is saying that XOAUTH2 method is not available on the server. Can you please contact your host to allow_url_fopen? Please also make sure that port 587 is open and supports TLS encryption.

      1. Per my hosting co, port 587 was open, and the allow_url_fopen has now been set. This resulted in no change to the error. It does seem that I am getting to an SMTP server, but the wrong server. Is that your interpretation? Confirming the allow_url_fopen, server now yields:
        OS: Linux vm361.tmdcloud.com 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64
        PHP version: 5.6.30
        WordPress version: 4.7.4
        WordPress multisite: No
        openssl: Available
        allow_url_fopen: Enabled
        stream_socket_client: Available
        fsockopen: Available
        cURL: Available
        cURL Version: 7.53.1, OpenSSL/1.0.1e

        The test email still yields (in full):
        Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
        Connection: opened
        SMTP -> get_lines(): $data is “”
        SMTP -> get_lines(): $str is “220-vm361.tmdcloud.com ESMTP Exim 4.89 #1 Sat, 13 May 2017 22:02:51 +0000 ”
        SMTP -> get_lines(): $data is “220-vm361.tmdcloud.com ESMTP Exim 4.89 #1 Sat, 13 May 2017 22:02:51 +0000 ”
        SMTP -> get_lines(): $str is “220-We do not authorize the use of this system to transport unsolicited, ”
        SMTP -> get_lines(): $data is “220-vm361.tmdcloud.com ESMTP Exim 4.89 #1 Sat, 13 May 2017 22:02:51 +0000 220-We do not authorize the use of this system to transport unsolicited, ”
        SMTP -> get_lines(): $str is “220 and/or bulk e-mail.”
        SERVER -> CLIENT: 220-vm361.tmdcloud.com ESMTP Exim 4.89 #1 Sat, 13 May 2017 22:02:51 +0000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
        CLIENT -> SERVER: EHLO goldengateconsulting.com
        SMTP -> get_lines(): $data is “”
        SMTP -> get_lines(): $str is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]”
        SMTP -> get_lines(): $str is “250-SIZE 52428800”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800”
        SMTP -> get_lines(): $str is “250-8BITMIME”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME”
        SMTP -> get_lines(): $str is “250-PIPELINING”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING”
        SMTP -> get_lines(): $str is “250-AUTH PLAIN LOGIN”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN”
        SMTP -> get_lines(): $str is “250-STARTTLS”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS”
        SMTP -> get_lines(): $str is “250 HELP”
        SERVER -> CLIENT: 250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
        CLIENT -> SERVER: STARTTLS
        SMTP -> get_lines(): $data is “”
        SMTP -> get_lines(): $str is “220 TLS go ahead”
        SERVER -> CLIENT: 220 TLS go ahead
        CLIENT -> SERVER: EHLO goldengateconsulting.com
        SMTP -> get_lines(): $data is “”
        SMTP -> get_lines(): $str is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]”
        SMTP -> get_lines(): $str is “250-SIZE 52428800”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800”
        SMTP -> get_lines(): $str is “250-8BITMIME”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME”
        SMTP -> get_lines(): $str is “250-PIPELINING”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING”
        SMTP -> get_lines(): $str is “250-AUTH PLAIN LOGIN”
        SMTP -> get_lines(): $data is “250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN”
        SMTP -> get_lines(): $str is “250 HELP”
        SERVER -> CLIENT: 250-vm361.tmdcloud.com Hello goldengateconsulting.com [192.168.1.5]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250 HELP
        Auth method requested: XOAUTH2
        Auth methods available on the server: PLAIN,LOGIN
        SMTP Error: Could not authenticate.
        CLIENT -> SERVER: QUIT
        SMTP -> get_lines(): $data is “”
        SMTP -> get_lines(): $str is “221 vm361.tmdcloud.com closing connection”
        SERVER -> CLIENT: 221 vm361.tmdcloud.com closing connection
        Connection: closed
        SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

          1. So, I’ve had this work at this hosting service before. But, things do get configured differently. What exactly do I need to ask them for or to do? Is there a specific PHPMailer command that is failing that I can point out to them? How do I help them help me? Greatly appreciated…as I’m not sure what to ask my hosting co to do.

  25. Hello, I just configured the plugin as the instructions and I’m getting the second error:

    400. Isto é um erro.

    Erro: invalid_scope

    You don’t have permission to access some scopes. Your project is trying to access scopes that need to go through the verification process. {invalid = [https://mail.google.com/]} If you need to use one of these scopes, submit a verification request.

    Can you help me please? Thanks!

    1. I recently ran across this. And, if you go to: https://groups.google.com/forum/#!forum/risky-access-by-unreviewed-apps and join the group, it will allow the app to connect (validate) without having to get scopes form approval. I’m not sure what prompts this form requirement, because I’ve installed the plugin successfully without running across this.

      1. Hello, I joined the group https://groups.google.com/forum/#!forum/risky-access-by-unreviewed-apps as suggested and it worked!

  26. WordPress email notifications, like those with Wordfence, are not formatted properly since installing the Gmail SMTP plugin. They are coming in with no line breaks, making them appear as one long line of text. Any help on how to fix this would be great, thanks.

  27. Error: invalid_scope every time i get this error , i have process the same as you explain here . can you please explain me how it’s working .

  28. I am having an issue with a client, when she changes her password for her Google account the Gmail SMTP plugin no longer works. I have to go in with the new password and refresh the token and create a new credential. Why is it no longer working after a user changes their password? This seems to be something recent, maybe Google changed something?

  29. Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
    Connection: stream_socket_client not available, falling back to fsockopen
    Connection: Failed to connect to server. Error number 2. “Error notice: fsockopen() has been disabled for security reasons
    SMTP ERROR: Failed to connect to server: (0)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    I try so many times but fail
    Please support to me

    1. @Bằng, The log data is actually telling you what needs to be fixed. First, stream_socket_client is not available on your server. So it’s falling back to fsockopen which is not enabled on your server either. So the plugin has no way to connect to the remote gmail SMTP server.

      I would also recommend you to change to port 587 and use TLS encryption (SSL encryption is pretty old).

  30. Hi…. I changed the server and now Gmail SMTP isn’t working. Is it a problem with my new server’s configuration?

    Error:

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
    Connection: opened
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “220 smtp.gmail.com ESMTP f72sm6140677qke.25 – gsmtp”
    SERVER -> CLIENT: 220 smtp.gmail.com ESMTP f72sm6140677qke.25 – gsmtp
    CLIENT -> SERVER: EHLO ~^(www\\.)?(?.+)$
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “501-5.5.4 HELO/EHLO argument “~^(www\\.)?(?.+)$” invalid, closing”
    SMTP -> get_lines(): $data is “501-5.5.4 HELO/EHLO argument “~^(www\\.)?(?.+)$” invalid, closing”
    SMTP -> get_lines(): $str is “501-5.5.4 connection.”
    SMTP -> get_lines(): $data is “501-5.5.4 HELO/EHLO argument “~^(www\\.)?(?.+)$” invalid, closing501-5.5.4 connection.”
    SMTP -> get_lines(): $str is “501 5.5.4 https://support.google.com/mail/?p=helo f72sm6140677qke.25 – gsmtp”
    SERVER -> CLIENT: 501-5.5.4 HELO/EHLO argument “~^(www\\.)?(?.+)$” invalid, closing501-5.5.4 connection.501 5.5.4 https://support.google.com/mail/?p=helo f72sm6140677qke.25 – gsmtp
    SMTP ERROR: EHLO command failed: 501-5.5.4 HELO/EHLO argument “~^(www\\.)?(?.+)$” invalid, closing501-5.5.4 connection.501 5.5.4 https://support.google.com/mail/?p=helo f72sm6140677qke.25 – gsmtp
    CLIENT -> SERVER: HELO ~^(www\\.)?(?.+)$
    SERVER -> CLIENT:
    SMTP ERROR: HELO command failed:
    SMTP NOTICE: EOF caught while checking if connected
    Connection: closed
    SMTP Error: Could not connect to SMTP host.
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

      1. A friend of mine did it for me. He installed nginx, Php7, etc.
        Basicly is the same estructure of the old server. I’m suspicious that it’s something misconfigured (related to smtp connect).
        How can I check if smtp connect, PHPMailer, etc. are fine?

        1. @Marco, Do you have all the info saved in the settings? If so please follow the instructions in the “Fresh Authorization / Removing Access From the Application” section.

          1. Hi… I did it. But it still doesn’t working.
            The same error is happening.

  31. hi,
    the below error message i receive on Test Email tab:
    Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ()
    Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (No connection could be made because the target machine actively refused it.)
    SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    please help.

  32. Hi!

    I followed the instructions and thought it worked. Until I tried to send an email. I get a “405 Not Allowed” message. I’ve passed the grant access successfully and thought I had it working.
    What causes this error?

    I had to become a member of the Google group Allow Risky Access Permissions By Unreviewed Apps to get the grant access. The site is registered in the Search Console.

    Thank you!

  33. I am getting below error, I am on digital ocean, tried below methods:
    – Disable IPv6
    – Increasing time outs – fastcgi_read_timeout 120;

    upstream timed out (110: Connection timed out) while reading response header from upstream, client: 167.220.238.130, server: mxc-test.couponwish.in, request: “POST /wp-admin/options-general.php?page=gmail-smtp-settings&action=test-email HTTP/1.1”,

    upstream: “fastcgi://unix:/run/php/php7.0-fpm.sock”, host: “”, referrer: “http:///wp-admin/options-general.php?page=gmail-smtp-settings&action=test-email”

  34. Hi, can this plugin use a different e-mail to send the mail?, i need to send from no-reply-domain@gmail.com but i want the developer console under admin-domain@gmail.com

    1. @Leonardo, Gmail doesn’t let you change the from email address for security reasons. The plugin does pass it to their API but they simply ignore it at the moment.

  35. Still struggling with adding info@mydomain.com. Info@ is actually a Distribution Group alias hence no actual login username and password. Any other ways to change FROM email to info@mydomain.com? Thanks.

    1. @Prageeth, Can you please explain what you are trying to do? You can specify any from email address as you want in the settings. But the OAuth setup needs to be done with a Gmail account (which will send the actual email).

      1. Hi, thanks for the quick reply. I setup Gmail SMTP v1.1.2 using a Gmail email for OAuth Email Address. All went well.
        However, I want our info@mydomain.com to be the ‘From Email Address’ and not the Gmail email. Firstly I changed ‘From Email Address’ to info@mydomain.com. Then I went in to account ‘Settings’ in Gmail > Accounts and import> Send mail as > here, I tried to add info@ourdomain.com but it prompts me to provide SMTP server, username and password. Username and password do not exist as the email address I want (info@mydomain.com) to use as ‘From Email Address’ is a Distribution Group email in Exchange Server.

        How do I make info@mydomain.com as ‘From Email Address’?

        1. @Prageeth, For security reasons Gmail doesn’t allow you to change the from email address at the moment. The plugin does pass it to their API but It automatically overrides the from address with your OAuth email address.

  36. Hi there, the plugin was working fine until a few days ago and then now i keep getting the following errors. Your URGENT response would be appreciated:

    Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
    Connection: opened
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “220-melfi.bbsnoc.com ESMTP Exim 4.89 #1 Mon, 26 Jun 2017 18:10:54 +1000 ”
    SMTP -> get_lines(): $data is “220-melfi.bbsnoc.com ESMTP Exim 4.89 #1 Mon, 26 Jun 2017 18:10:54 +1000 ”
    SMTP -> get_lines(): $str is “220-We do not authorize the use of this system to transport unsolicited, ”
    SMTP -> get_lines(): $data is “220-melfi.bbsnoc.com ESMTP Exim 4.89 #1 Mon, 26 Jun 2017 18:10:54 +1000 220-We do not authorize the use of this system to transport unsolicited, ”
    SMTP -> get_lines(): $str is “220 and/or bulk e-mail.”
    SERVER -> CLIENT: 220-melfi.bbsnoc.com ESMTP Exim 4.89 #1 Mon, 26 Jun 2017 18:10:54 +1000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
    CLIENT -> SERVER: EHLO cym.org
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]”
    SMTP -> get_lines(): $str is “250-SIZE 52428800”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800”
    SMTP -> get_lines(): $str is “250-8BITMIME”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800250-8BITMIME”
    SMTP -> get_lines(): $str is “250-PIPELINING”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800250-8BITMIME250-PIPELINING”
    SMTP -> get_lines(): $str is “250-AUTH PLAIN LOGIN”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN”
    SMTP -> get_lines(): $str is “250-STARTTLS”
    SMTP -> get_lines(): $data is “250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS”
    SMTP -> get_lines(): $str is “250 HELP”
    SERVER -> CLIENT: 250-melfi.bbsnoc.com Hello cym.org [209.141.49.197]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
    CLIENT -> SERVER: STARTTLS
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “220 TLS go ahead”
    SERVER -> CLIENT: 220 TLS go ahead
    SMTP Error: Could not connect to SMTP host.
    CLIENT -> SERVER: QUIT
    SMTP -> get_lines(): $data is “”
    SMTP -> get_lines(): $str is “221 melfi.bbsnoc.com closing connection”
    SERVER -> CLIENT: 221 melfi.bbsnoc.com closing connection
    Connection: closed
    SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Leave a Reply

Your email address will not be published. Required fields are marked *