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

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

    Reply
    • @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?

      Reply
      • 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.

        Reply
    • I am also getting this error…

      Reply
      • Hello ,

        Same error for me .
        What is the solution ?

        Regards,

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

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

    Reply
  5. 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

    Reply
    • @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.

      Reply
      • @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

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

          Reply
  6. 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

    Reply
  7. 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!

    Reply
  8. 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.”

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

      Reply
  9. 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

    Reply
    • @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.

      Reply
      • I tried 587 and it didn’t work. if I am hosted by godaddy will I have to contact them?

        Reply
  10. 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.

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

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

        Reply
      • After whitelisting multiple IPs for gmail’s servers, it is all working. Many thanks.

        Reply
  11. 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.

    Reply
    • @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.

      Reply
  12. 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…

    Reply
  13. 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.

    Reply
    • @Kbrannen, Did you contact bluehost to make sure that port 587 is open and supports TLS encryption?

      Reply
  14. 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

    Reply
  15. 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

    Reply
    • @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.

      Reply
      • Thank you. Have made the request. Will follow up upon changes having been made.

        Reply
      • 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

        Reply
          • 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.

  16. 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!

    Reply
    • @Roberta, Does your project have the Gmail API enabled in it?

      Reply
      • Yes! Everything has been set up according to the instructions.

        Reply
      • I am also getting same error. Gmail API is already enabled.

        Reply
        • Did you manage to fix this?

          Reply
      • I am getting the same error. Can you please help me?

        Reply
    • 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.

      Reply
      • Thanks!!!
        Worked correctly after joining the group!!!

        Reply
    • Did you solved your problem ?
      I have same problem too…

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

        Reply
        • Glad I could help. I’m still struggling with my issue, above…

          Reply
  17. 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.

    Reply
  18. 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 .

    Reply
  19. 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?

    Reply
  20. 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

    Reply
    • @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).

      Reply

Leave a Comment