Gmail SMTP Plugin for WordPress

Gmail SMTP is an advanced SMTP mailing plugin for WordPress for sending an 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 wordpress plugin

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 an email. This is to make sure that users can still get full benefits of the default email functionality.

3. Gmail SMTP plugin takes a 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.

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 naa986”
  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

Gmail SMTP Project Creation

1. Go to console.cloud.google.com/apis/dashboard.

2. Login to your Google account which will be used to send an 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.

Credentials/App Creation

1. Once the project is created go to Credentials > CREATE CREDENTIALS and select OAuth client ID.

2. In order to create an OAuth client ID, you need to configure the OAuth consent screen first. So click CONFIGURE CONSENT SCREEN.

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

3. Choose how you want to configure and register your app. Since I’m not using G Suite I had to choose External.

screenshot showing how to choose a user type in the oauth consent screen of the google developers console

4. Enter a name (e.g. Gmail SMTP) for the OAuth consent screen.

screenshot showing the OAuth consent screen 2 in the google developers console

5. You can configure optional fields such as Authorized domains, Application home page, Application privacy policy link and Application terms of service link (I was able to skip all and click SAVE AND CONTINUE). You do however need to enter an email address under the Developer contact information section.

screenshot showing part 2 of the consent screen 2 in the google developers console

6. Skip the Scopes screen.

screenshot showing the Scopes tab in the OAuth consent screen of the Google cloud console

7. Add a test user if you plan to use this app in test mode (This is not required if you want to publish it).

screenshot showing the Test users tab in the OAuth consent screen of the Google cloud console

8. Keep your app in test mode or publish it. If the Publishing status is set to In production, a warning message (This app isn’t verified) may appear on the consent screen that you can easily skip.

screenshot showing the Summary tab in the OAuth consent screen of the Google cloud console

Now that the OAuth consent screen has been configured you can create an OAuth Client ID.

9. Go to the Credentials tab and select OAuth client ID under CREATE CREDENTIALS.

screenshot showing how to select OAuth client Id under CREATE CREDENTIALS in the google developers console

10. Set the application type to Web application and enter a name for it (e.g. Gmail SMTP App). 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

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

Gmail SMTP Settings Configuration

1. 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.

2. 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

3. 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

4. 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.

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 that the plugin received when you first granted your app access to the Gmail API. This token is necessary to communicate with the Gmail API and send an email. In order to avoid any confusion, the plugin does not show it on the settings page.

Once you delete this token the plugin can no longer connect to the Gmail SMTP server or send an 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.

Gmail SMTP Add-ons

Gmail SMTP plugin comes with add-ons that you can use to enhance its functionality on your website.

Reply-To

Reply-To add-on lets you set a reply-to address for all outgoing email messages.

Cc

Cc add-on lets you set a cc recipient for all outgoing email messages.

712 thoughts on “Gmail SMTP Plugin for WordPress”

  1. I get the following error when Granting permission to use Gmail

    Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-content\plugins\gmail-smtp\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-content\plugins\gmail-smtp\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-content\plugins\gmail-smtp\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-content\plugins\gmail-smtp\google-api-php-client\vendor\guzzl in C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-content\plugins\gmail-smtp\google-api-php-client\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

    Fatal error: Cannot declare class phpmailerException, because the name is already in use in C:\inetpub\wwwroot\Cypriotsworldwide.com\wp-includes\class-phpmailer.php on line 4040

    Reply
  2. Hi I have had the following de-bug issue come up. Is the best solution to re-install the plugin?

    Uncaught Exception: Invalid token format in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Client.php on line 434
    setAccessToken()
    wp-content/plugins/gmail-smtp/class.phpmaileroauthgoogle.php:145
    getOauth64()
    wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php:475
    authenticate()
    wp-content/plugins/gmail-smtp/class.phpmaileroauth.php:152
    smtpConnect()
    wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php:1542
    smtpSend()
    wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php:1337
    postSend()
    wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php:1215
    send()
    wp-content/plugins/gmail-smtp/main.php:943
    wp_mail()
    wp-content/plugins/gmail-smtp/main.php:183
    test_email_settings()
    wp-content/plugins/gmail-smtp/main.php:120
    options_page()
    wp-includes/class-wp-hook.php:286
    apply_filters()
    wp-includes/class-wp-hook.php:310
    do_action()
    wp-includes/plugin.php:465
    do_action()
    wp-admin/admin.php:253
    require_once()
    wp-admin/options-general.php:10

    Reply
  3. Is the plugin still working w/t WP newest version?
    When I upgraded to version 5.2.4, it stopped sending email.
    It displays “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”
    at the end of the test message box.
    “2019-11-08 08:26:14 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
    2019-11-08 08:26:14 Connection: opened
    2019-11-08 08:26:14 SMTP -> get_lines(): $data is “”
    2019-11-08 08:26:14 SMTP -> get_lines(): $str is “220 smtp.gmail.com ESMTP c12sm6529663pfp.67 – gsmtp”
    2019-11-08 08:26:14 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP c12sm6529663pfp.67 – gsmtp
    2019-11-08 08:26:14 CLIENT -> SERVER: EHLO chothuephonghoithao.vn
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-SIZE 35882577”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-8BITMIME”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-STARTTLS”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-STARTTLS”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-ENHANCEDSTATUSCODES”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-PIPELINING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-CHUNKING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250 SMTPUTF8”
    2019-11-08 08:26:15 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
    2019-11-08 08:26:15 CLIENT -> SERVER: STARTTLS
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “220 2.0.0 Ready to start TLS”
    2019-11-08 08:26:15 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
    2019-11-08 08:26:15 CLIENT -> SERVER: EHLO chothuephonghoithao.vn
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-SIZE 35882577”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-8BITMIME”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-ENHANCEDSTATUSCODES”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-PIPELINING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250-CHUNKING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “250 SMTPUTF8”
    2019-11-08 08:26:15 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [2400:8901::f03c:91ff:fe1f:986f]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
    2019-11-08 08:26:15 Auth method requested: XOAUTH2
    2019-11-08 08:26:15 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
    2019-11-08 08:26:15 CLIENT -> SERVER: QUIT
    2019-11-08 08:26:15 SMTP -> get_lines(): $data is “”
    2019-11-08 08:26:15 SMTP -> get_lines(): $str is “221 2.0.0 closing connection c12sm6529663pfp.67 – gsmtp”
    2019-11-08 08:26:15 SERVER -> CLIENT: 221 2.0.0 closing connection c12sm6529663pfp.67 – gsmtp
    2019-11-08 08:26:15 Connection: closed

    The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”
    It’s not just my website, I tested on many other of my websites and had same issues.
    Thank you

    Reply
    • I received the following error.

      2019-11-14 22:30:44 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
      2019-11-14 22:30:45 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Connection refused) [/home/adminerp/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php line 298]
      2019-11-14 22:30:45 SMTP ERROR: Failed to connect to server: Connection refused (111)
      SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

      please, I need your help, thanks a lot.

      Regards
      Ismael

      Reply
      • @Ismael, The log shows that the plugin is not being able to connect to the remote SMTP server. Please contact your host to make sure that port 587 is open and supports TLS encryption.

        Reply
        • @Noor Alam, I have same issue. I check my gmail and I enable IMAP on email, it work well someday ago. Today it stop work and i test send email and see the error message.

          Reply
  4. I am seeing authorisation failures. I have checked the client ID and secret are correct – even reset it – and the Google email address from the console is correct. It has previously been working. Any ideas?

    2019-11-15 12:51:50 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH
    2019-11-15 12:51:51 CLIENT -> SERVER: AUTH XOAUTH2 dXNlcj1hZG1pbkBjZWx0aWMtY29tbWVyY2UuY29tAWF1dGg9QmVhcmVyIAEB
    2019-11-15 12:51:52 SMTP -> get_lines(): $data is “”
    2019-11-15 12:51:52 SMTP -> get_lines(): $str is “334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==”
    2019-11-15 12:51:52 SERVER -> CLIENT: 334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==
    2019-11-15 12:51:52 SMTP ERROR: AUTH command failed: 334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==
    SMTP Error: Could not authenticate.
    2019-11-15 12:51:52 CLIENT -> SERVER: QUIT
    2019-11-15 12:51:52 SMTP -> get_lines(): $data is “”
    2019-11-15 12:51:52 SMTP -> get_lines(): $str is “535-5.7.8 Username and Password not accepted. Learn more at”
    2019-11-15 12:51:52 SMTP -> get_lines(): $data is “535-5.7.8 Username and Password not accepted. Learn more at”
    2019-11-15 12:51:52 SMTP -> get_lines(): $str is “535 5.7.8 support.google.com/mail/?p=BadCredentials e16sm297716wrj.80 – gsmtp”
    2019-11-15 12:51:52 SERVER -> CLIENT: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 support.google.com/mail/?p=BadCredentials e16sm297716wrj.80 – gsmtp
    2019-11-15 12:51:52 SMTP ERROR: QUIT command failed: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 support.google.com/mail/?p=BadCredentials e16sm297716wrj.80 – gsmtp
    2019-11-15 12:51:52 Connection: closed
    SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Reply
    • @Tony, Have you changed your password recently? Although the plugin doesn’t use your username or password for authentication, it seems to cause an issue on Gmail’s end.

      Reply
      • You are referring to the password for the gmail console account? No. It’s been the same for six months.

        Reply
        • @tony, Have you tried a fresh authorization? If not please check this section “Fresh Authorization / Removing Access From the Application” for details.

          Reply
          • Hi I am having the same issue, where can i find ths section “Fresh Authorization / Removing Access From the Application” To continue with the steps?
            Thank you

          • Ok I got itm thank you!

    • Hi, I have gotten the same problem with my sub domain website. The top domain website works well.

      SMTP Error: Could not authenticate.
      2020-03-15 13:32:24 CLIENT -> SERVER: QUIT
      2020-03-15 13:32:24 SMTP -> get_lines(): $data is “”
      2020-03-15 13:32:24 SMTP -> get_lines(): $str is “535-5.7.8 Username and Password not accepted. Learn more at”
      2020-03-15 13:32:24 SMTP -> get_lines(): $data is “535-5.7.8 Username and Password not accepted. Learn more at”
      2020-03-15 13:32:24 SMTP -> get_lines(): $str is “535 5.7.8 https://support.google.com/mail/?p=BadCredentials e28sm62371377pgn.21 – gsmtp”
      2020-03-15 13:32:24 SERVER -> CLIENT: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials e28sm62371377pgn.21 – gsmtp
      2020-03-15 13:32:24 SMTP ERROR: QUIT command failed: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials e28sm62371377pgn.21 – gsmtp
      2020-03-15 13:32:24 Connection: closed
      SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

      Thanks!

      Reply
  5. That got it, thanks!

    Reply
  6. Hello,

    Everything seems going well at first sight but… when I try to send the test eMail, nothing happened, I didn’t get any eMail, I tried SSL/TLS, ports, adding eMail on “From Email Address” field or remove it, and various settings and test eMail addresses.

    I get no error message anywhere (including gmail console) but when subscribing a test form, then I get a “server error : form not sent”

    Do you have an idea of what could be wrong ?

    Regards

    Reply
  7. I received the following error.

    Fatal error: Uncaught Error: Call to undefined method Google_Client::getRefreshToken() in /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/class.phpmaileroauthgoogle.php:150 Stack trace: #0 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php(475): GmailXOAuth2->getOauth64() #1 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/class.phpmaileroauth.php(152): SMTP->authenticate(”, ”, ‘XOAUTH2’, ”, ”, Object(GmailXOAuth2)) #2 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(1542): PHPMailerOAuth->smtpConnect(Array) #3 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(1337): PHPMailer->smtpSend(‘Date: Thu, 19 D…’, ‘Gmail SMTP v1.1…’) #4 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(1215): PHPMailer->postSend() #5 /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/ in /var/www/vhosts/giaiphapit.com.vn/httpdocs/wp-content/plugins/gmail-smtp/class.phpmaileroauthgoogle.php on line 150

    please, I need your help, thanks a lot.

    Regards,
    Steven

    Reply
    • @steven, Please check the instructions in the fresh authorization section and see how it goes.

      Reply
  8. I am getting this error message:

    Invalid address: (setFrom) [my email address]
    Invalid address: (addAnAddress to): [to email address]

    This is the server info:
    OS: Linux s341.syd1.hostingplatform.net.au 3.10.0-962.3.2.lve1.5.24.6.el7.x86_64 #1 SMP Tue Dec 4 03:50:32 EST 2018 x86_64
    PHP version: 7.4.0
    WordPress version: 5.3.2
    WordPress multisite: No
    openssl: Available
    allow_url_fopen: Enabled
    stream_socket_client: Available
    fsockopen: Available
    cURL: Available
    cURL Version: 7.62.0, OpenSSL/1.0.2k

    Reply
    • @NRF, When do you see this error? Can you please provide the full log?

      Reply
  9. We get a similar error when sending the Test Email

    Invalid address: (setFrom) [from address]
    Invalid address: (addAnAddress to): [recipient address]

    But both addresses used are valid and work in other applications

    Reply
    • Can anyone advise what causes this error and how to fix please?

      Invalid address: (setFrom) kerry@orlandobaggagestorage.com
      Invalid address: (addAnAddress to): help@ozewebhelp.com.au

      Reply
  10. Hello

    I have successfully installed this plugin, but it display an error (Gmail SMTP plugin cannot send email until you enter your credentials in the settings and grant access to your web application.) How to fix this let me know.

    Thanks

    Reply
    • Its happening the same for me too. The SMTP status is “connected” but it shows that error message on the top of the page.

      Reply
      • I’m having the same issue. I’m testing as a lighter alternative to other SMTP plugins. Seems like a bug to me.

        Reply
  11. Hi there,

    I tried this smtp plugin, but I can’t pass the last step – every time I clicked the “Allow” in the google permission page, it will take me to a 403 Forbidden page….

    Don’t know why. Any clue or suggestion?

    Thanks!

    Reply
  12. The From Email Address field has one email address, but the sender on the test emails is my Gmail account that I used to configure the plugin. Any thoughts on how to fix it?

    Reply
    • Did you figure this out?

      I wanted emails to be “from” my support group (support@domain.com), which I am a member of. I had to authorize it from my user account.

      But the emails arrive from my useraccount (me@domain.com) instead.

      Everything else works NICELY…

      Reply
  13. Hello

    I’m running
    – WP 5.3.2
    – Gmail SMTP: 1.1.9
    – PHP: 7.3.14
    – TLS port 587

    I have set up a Gmail account with OAuth and copied the credentials into the plugin.

    I seem to be getting a problem with STARTTLS that’s causing the following:

    2020-02-06 18:03:01 Connection: opening to 127.0.0.1:25, timeout=300, options=array ()
    2020-02-06 18:03:01 Connection: opened
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “220 pool3-209-36.bur.atomicsites.net ESMTP Postfix (Debian/GNU)”
    2020-02-06 18:03:01 SERVER -> CLIENT: 220 pool3-209-36.bur.atomicsites.net ESMTP Postfix (Debian/GNU)
    2020-02-06 18:03:01 CLIENT -> SERVER: EHLO thegentletable.com
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-pool3-209-36.bur.atomicsites.net”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-PIPELINING”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-SIZE 10240000”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-VRFY”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-ETRN”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-AUTH PLAIN”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH PLAIN”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-ENHANCEDSTATUSCODES”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH PLAIN250-ENHANCEDSTATUSCODES”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250-8BITMIME”
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “250 DSN”
    2020-02-06 18:03:01 SERVER -> CLIENT: 250-pool3-209-36.bur.atomicsites.net250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN
    2020-02-06 18:03:01 CLIENT -> SERVER: STARTTLS
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “502 5.5.1 Error: command not implemented”
    2020-02-06 18:03:01 SERVER -> CLIENT: 502 5.5.1 Error: command not implemented
    2020-02-06 18:03:01 SMTP ERROR: STARTTLS command failed: 502 5.5.1 Error: command not implemented
    SMTP Error: Could not connect to SMTP host.
    2020-02-06 18:03:01 CLIENT -> SERVER: QUIT
    2020-02-06 18:03:01 SMTP -> get_lines(): $data is “”
    2020-02-06 18:03:01 SMTP -> get_lines(): $str is “221 2.0.0 Bye”
    2020-02-06 18:03:01 SERVER -> CLIENT: 221 2.0.0 Bye
    2020-02-06 18:03:01 Connection: closed
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    As a result, no email can be sent from the site. I’ve tried turning off plugins, no change. … tried using both encryption types and their respective ports as well as disabling SSL verification. Those options produce different errors, but none allow me to send email.

    Can you point me in the right direction?

    Thanks

    Reply
  14. hello!

    It works on my web site well.

    How could I customize the content of the registion Email. It’s too simple…….

    Thanks!

    Reply
  15. You need to update your installation instructions. The Google Developer Console has changed. There are subtle differences from what your instructions show and there are omissions possibly due to your instructions not being updated. I wasted over 2 hours trying to figure out the gaps. I finally gave up and searched for another plugin which had a simpler process and instructions that matched exactly what you see in the Google Developer Console. I strongly advise that you update your installation instructions .

    Reply
  16. This tutorial video is too outdated to use. I am going to have to disable my contact page. I can’t get emails to send. boo. please let me know if you update it. I am done for now.

    Reply
    • @Melanie, The documentation has already been updated.

      Reply
  17. Please anybody help me for this case:-

    The error mesage like this:
    2020-06-02 08:04:59 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
    2020-06-02 08:04:59 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network is unreachable) [/srv/disk1/3356389/www/agsasidar.com/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php line 298]
    2020-06-02 08:04:59 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    I don’t know, how to solve it. Please help me to solve this problems

    Reply
    • I have the same error, can anyone help us?

      Reply
      • I have same issue today. Does anyone has solution?

        Reply
  18. Is their any restriction by Google if we send 300 emails in a single shot as notification to all website registered by using this Plugin. We have tried to send by using this plugin and our configured email account get freezed for few minutes and no email get triggered. Do you have any idea and solution for this.

    Please let me know

    Reply
  19. I’m getting “There has been a critical error on your website. Please check your site admin email inbox for instructions.”

    I can go back into the site but the gmail status is unset

    Reply
  20. 2020-07-26 15:49:48 Connection: opening to ssl://smtp.gmail.com:587, timeout=10, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
    2020-07-26 15:49:49 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F10B:SSL routines:ssl3_get_record:wrong version number [/home/printitnice/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php line 298]
    2020-07-26 15:49:49 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/printitnice/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php line 298]
    2020-07-26 15:49:49 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) [/home/printitnice/public_html/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php line 298]
    2020-07-26 15:49:49 SMTP ERROR: Failed to connect to server: (0)
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Reply
    • @manthan, Please contact your web host to make sure that port 587 is open and supports TLS encryption.

      Reply

Leave a Comment