WPForms Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

Securely Send WordPress Emails with Gmail SMTP

How to Securely Send WordPress Emails Using Gmail SMTP with WP Mail SMTP

by Shahzad Saeed on Jan 16, 2018

Looking for a secure SMTP plugin that helps you receive email notifications from your WordPress contact forms? With WP Mail SMTP, you can fix delivery issues by authenticating emails through your Gmail or G Suite account — all while keeping your login credentials safe.

In this post, we’ll show you how to set up WP Mail SMTP for sending WordPress emails with your Gmail or G Suite email address.

Why You’re Not Receiving Notifications

By default, WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms.  The most common reason for not getting emails is that your WordPress hosting server is not configured to use PHP mail function.

In addition to this, anti-spam efforts by email providers can impact your emails as well. As part of their filtering process, many email providers will check whether your email originates from the same domain noted in the From Email. For example, if your email claims to be sent from your Gmail address but is actually sent from your website’s server (rather than Gmail’s server), your email may be sent to spam or not be delivered at all.

You can fix this by using SMTP instead of the PHP mail function. SMTP (Simple Mail Transfer Protocol) is the industry standard for sending emails reliably.

Why Use the WP Mail SMTP Plugin?

The main benefit of using the WP Mail SMTP plugin is that it lets you send WordPress emails securely using your Gmail or G Suite account without requiring to enable less secure apps in your account.

In addition, unlike many other SMTP options, you won’t need to enter your Gmail username and password in your WordPress dashboard where other site users can see them. By using this method, you’ll help to keep your WordPress site secure.

Let’s take a look at how to set up WP Mail SMTP for sending WordPress emails.

Step 1: Install the WP Mail SMTP Plugin

The first thing you need to do is to install and activate the WP Mail SMTP plugin. For step-by-step instructions, you can check out WPBeginner’s guide on how to install a WordPress plugin.

After installing and activating WP Mail SMTP, go to Settings » WP Mail SMTP to open the plugin settings page.

At the top of this page, you can set the From Email and From Name. By default, these will fill with your site’s admin email and site name.

WP Mail SMTP settings

For the From Email, be sure this is set to your Gmail or G Suite email address before continuing.

After these basic settings are ready, you’ll need to scroll to the Mailer field and select the Gmail option.

We also recommend checking the Return Path option to Set the return-path to match the From Email. That way, you’ll be notified about bounced emails, just as you would when using your email normally.

Choose Gmail for SMTP mailer

Next, you should see a new Gmail section appear. Here, you’ll see fields for Client Secret and Client ID.

To get the information for these fields, you’ll need to create a web application through your Google account. This doesn’t require any coding, and we’ll show you exactly what to do.

Step 2: Create a Web Application

To create an application, you’ll first need to sign in and access Gmail’s application registration. Clicking that link should open this Google page in a new tab or window, and you’ll want to keep your site settings open (we’ll return to those later).

Once you’ve followed that link and logged into your Gmail account, you should see a form named “Register your application for Gmail API in Google API Console”.

In the dropdown labeled Select a project where your application will be registered, leave the default option of Create a project. Then, go ahead and click the Continue button.

Create a project for Gmail app registration

Next, you should see a screen that says “The API is enabled”. To proceed to the setup page, click the Go to credentials button.

Gmail API is enabled

In the next page, you’ll be prompted to determine the credentials you need. Here are the fields on this page and the options you’ll need to select:

  • Which API are you using? Gmail API
  • Where will you be calling the API from? Web server (e.g. node.js, Tomcat)
  • What data will you be accessing? User data

Once you’ve made these selections, click the What credentials do I need? button to go to the next step.

Add credentials to Gmail app project

For this step, you’ll be creating an OAuth client ID. OAuth, or Open Authorization, is what will provide permission for your website to use your Gmail account to authenticate emails.

For the Name field, enter anything you like or leave the default name. This is only for reference within your Google account.

For the Authorized JavaScript origins, you’ll need to enter your site’s URL.

Last, we need to fill out the Authorized redirect URIs field. To get the URI for your site, you’ll need to go back to the tab or window with your WordPress site. Still on the Settings » WP Mail SMTP page, you’ll need to look under the Gmail section for the field labeled Authorized redirect URI.

The value in this field should be your site’s URL followed by some extra details. You’ll need to copy this value, which is easily done by clicking the button with the copy icon.

Use button to copy authorized redirect URI from WP Mail SMTP settings

After copying the URI, return to the Google APIs page and paste it into the field under Authorized redirect URIs.

Create a Google OAuth client ID

After that, you can click the Create client ID button.

For the last step in the app creation process, you’ll need to set up the consent screen. This screen will never be seen by your users since you’re only granting permission for your own site to use the Gmail account you own.

You’ll just need to check your email address and then enter a Product name shown to users (such as the title of your website). When you’ve completed these fields, click Continue.

oauth client id

You’ve now successfully created a Gmail web application!

Now we need to see the full details. On the last screen, click I’ll do this later to go to the Credentials page.

Last page in Gmail app setup process

Step 3: Grant Permissions and Send Test Email

On the Credentials page, you can now see the details of the web application you just created. To view Client ID and Client Secret, click the edit icon.

Click the edit icon on the Credentials page

This will open all of the details for your app. On this page, you’ll need to copy the Client ID and Client secret values.

Each of these will need to be copied into your WP Mail SMTP settings back in your WordPress admin.

Note: Be very careful not to copy any extra text or spaces with your Client ID or Client Secret, as this will result in an error in the next step.

Copy in Client ID and secret to WP Mail SMTP settings

After saving these settings, the page will refresh. Before Google allows this information to be used to connect to your account, however, you must grant permission.

To do this, scroll to the bottom of this page and click the button labeled Allow plugin to send emails using your Google account.

Authorize plugin to send emails with Gmail

This will open a login screen for Google. Go ahead and log into the account you’re setting this SMTP up with. Then, you’ll see a screen asking for permission for this site to send email on your behalf.

When you’re ready, click the Allow button to proceed.

Grant permission for site to send email

Next, you’ll be returned to your WP Mail SMTP settings and a success message will be displayed. Now that the connection is complete, you’re ready to send a test email under the Email Test tab.

Gmail connection success with WP Mail SMTP

Once the Test Email tab is open, you’ll need to enter a valid email address and click the Send Email button. Be sure to use an email address you have access to so you can confirm the email is delivered.

Send a test email through WP Mail SMTP

When the test message has been sent, you’ll see a success message at the top of this tab.

WP Mail SMTP test email was sent successfully

You should also soon receive a test email at the email address you entered.

Test email for WP Mail SMTP Gmail

What If the Test Email Doesn’t Send Successfully?

If the SMTP test email isn’t able to send, a debug log will appear with additional details. Here are some of the possible error messages and how to resolve them.

401. That’s an error.
Error: invalid_client

This error appears when the Client ID isn’t able to be read properly. To fix, try copying the Client ID in again and check that there’s no whitespace or extra text.

400. That’s an error.
Error: invalid_request
Missing required parameter: client_id

This error will display when the Client ID field is empty or not able to be read properly. To fix, copy in the Client ID again and be careful to not add extra text or whitespace.

cURL error 60: SSL certificate problem
This message means that the server is missing a certificate that’s required for SMTP to work. To fix, you’ll need to contact your site’s hosting provider to ask them to install this certificate (most likely the cacert.pem certificate, though it’s best to ask your host to check).

“code”: 401,
“message”: “Login Required”

If you see this in the debug message, permission still needs to be granted to your use Google account. For instructions on how to fix this, please see Step 3 of this tutorial. Also, be sure to check that the From Email in your SMTP settings matches the email used to setup the Google app.

That’s it! You’ve successfully configured SMTP on your WordPress site.

What are you waiting for? Get started with the most powerful WordPress forms plugin today.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

Comments

  1. Hehllo when I click “Allow” for google to send emails on your behalf , it takes me to a screen that says “Not Acceptable!

    An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.”

    1. Hi Jeremy.

      I’m sorry to hear you’re running into this issue. The best next step is to contact your site’s hosting provider, as this may be the result of security measures they have in place.

      If you still see this issue after giving that a try, would you please get in touch?

      Thanks! 🙂

      1. Hi. I also get the error message (Not Acceptable!
        An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.) when I try to log into Gmail.

        My Web Host provider asked me to send you this:

        Match of “beginsWith http://%{SERVER_NAME}/” against “MATCHED_VAR” required. [file “/opt/mod_security/10_asl_rules.conf”] [line “1969”] [id “340594”] [rev “16”] [msg “Remote File Injection attempt in ARGS”] [severity “CRITICAL”] [hostname “lifecentre.health”] [uri “/wp-admin/options-general.php”] [unique_id “WoL24sY597oADIi2GjgAAAAW”]

        Please help.

      2. Hi Alvin,

        I apologize, however Mod_Security issues are a result of incorrect configuration on the site’s server. We’re not able to resolve server issues, however your site’s hosting provider should be able to assist further. Specifically, we recommend contacting your web host and asking them to remove mod_security (or they can check the server logs to determine which specific rules to turn off).

        If your site’s host says that this isn’t possible (their server configuration doesn’t allow for these changes, etc), then the Gmail integration option is unfortunately not compatible with your site’s host. In this case, you’ll need to try one of our other SMTP options.

        I hope this helps!

      1. Hi Anthony,

        If you’re seeing issues while getting this set up, the best next step is to copy the error you see into the WP Mail SMTP support forum’s search (towards the top of this page).

        If you’re not able to find what you need there or have additional questions, please get in touch. Thanks!

    2. I am getting the “Not Acceptable” error too. I contacted Bluehost (my provider) and they say to contact the plugin’s developer. Any luck fixing the issue? If so, what did you do to correct?

      Thanks!!

      1. Hi Donny,

        This error is generally a result of a security measure on your site’s server needing rule changes. To address this, you’ll need to get in touch with your site’s hosting provider.

        And in case it’s useful, here’s our tutorial where we list this and other common issues/FAQ’s. I hope that helps! 🙂

    3. I also have received the “Not Acceptable… This error was generated by Mod_Security” message.

      I got into contact with Hostgator and spent a good half hour on the support chat walking through it with my support agent.

      I simply provided them screenshots and after some digging around, they resolved it by fixing some rule.

      So if you’re having the same problem, just keep trying until the right support person knows what they’re doing.

      1. Thanks, Spencer! Many SMTP issues are a result of server issues that a hosting provider can help to resolve, so this is great advice 🙂

  2. This link: ” sign in and access Gmail’s application registration”
    Signs us out of all Gmail accounts and continuously signs us out until I close all Gmail tabs. Notice that there’s a Logout in the URL.

    Anyways, I tried to follow your instructions for that part and Google wants to create a new project but I get an error. It also says that the project ID is: pelagic-media-188913

    Not sure who that is :).

    1. Hi Ramsey,

      I’m sorry for the trouble! When you get a chance, could you try opening an incognito window and trying these steps again from there? It sounds like this may be a cookies issue, which incog should help avoid.

      If that doesn’t do the trick, please get in touch and we’ll collect more details from there.

      Thanks! 🙂

      1. Not working in Firefox and Chrome. Incognito and normal mode. Reading the comments here, it seems like it’s not working for anyone with various issues.
        My issue could be related to my Google Apps for Business account. I enabled API access but it’s still not working. I get an error when creating a project. I’ll just use Other SMTP for now.

        I also don’t get notified by email when you reply to me here in the WP Forms comments :(. Had to check this manually.

      2. Nevermind! I got it to work. I had to enable Google Developers Console in Google Apps admin console. The rest worked fine.

      3. Hi Ramsey,

        Great, I’m glad you got that sorted — and thanks for letting us know! I’ve made a note to look into what you’ve described further, as well, and we’ll adjust the tutorial as needed.

        For the comment notifications, this is default WordPress functionality but I definitely agree with you — and I’ve noted that request for improvement as well.

        Thanks!

  3. hi there, i do try everything right without any problem but i give the authorization error and this log:
    Versions
    WordPress: 4.8.3
    PHP: 5.6.32
    WP Mail SMTP: 1.0.2

    PHPMailer
    ErrorInfo:
    Mailer: gmail
    Host: localhost
    Port: 25
    SMTPSecure: NULL
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(false)

      1. Was this ever resolved? I have the same error and can’t find a matching support ticket in the database to figure out how to fix it.

      2. Hi Talisan,

        Issues like this can vary from site to site, so for the fastest resolution please get in touch. From there we’ll be able to gather more details and work towards a solution.

        Thanks! 🙂

      1. Hi Scott,

        In case it helps, I searched this issue on the WP Mail SMTP support forum and found a thread where this issues was discussed: here’s that thread. Gmail SMTP issues like this most commonly stem from server configuration issues, which can vary quite a bit.

        If you check that out and still have questions, please get in touch! Thanks 🙂

  4. Keep getting notifications saying cannot connect to the Google api – not allowed.

    Red notification – sorry not on screen now so can’t give you exact detils – got to get back to other tasks.

    Tried three times – no luck.

  5. Hi,

    Thanks for the plugin and for the guide.

    I am trying to get the plugin working for me but somehow I’m stuck at the last few steps and would like to get your advice.

    After doing all the steps mentioned, when I clicked on the “Allow plugin to send emails using your Google Account” button, I was taken to the page to choose the Google Account that I am using. However after selecting the account and clicking “ALLOW” on the next page, all I’ve gotten is a page saying :
    “Not Acceptable!
    An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.”

    Do you know what can I do to resolve this? Thanks

    1. Hi Will,

      Sorry to hear you’re seeing an issue with this. This is likely a result of security measures on your site’s server, so the best next step is to contact your site’s hosting provider to see if they can resolve it.

      If you have any questions, or still see this issue after giving this a try, would you please get in touch?

      Thanks! 🙂

      1. Thanks for your advice, I’ll check with our hosting service provider to see if they can help us with this, thank!

  6. Having this message when I try sending a test email:

    There was a problem while sending a test email.

    The related debugging output is shown below:

    Versions
    WordPress: 4.9.1
    PHP: 5.6.31
    WP Mail SMTP: 1.0.2
    PHPMailer
    ErrorInfo:
    Mailer: gmail
    Host: localhost
    Port: 25
    SMTPSecure: NULL
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(false)

  7. Hi,

    i followed the tutorial without any luck.
    keep getting the below error

    There was a problem while sending a test email.

    The related debugging output is shown below:

    Versions
    WordPress: 4.6.1
    PHP: 5.6.31
    WP Mail SMTP: 1.0.2
    PHPMailer
    ErrorInfo:
    Mailer: gmail
    Host: localhost
    Port: 25
    SMTPSecure: NULL
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(false)

  8. My site Authorized redirect URI contains the Static IP, not the website address and is not editable.

    As a result I get:

    400. That’s an error.
    Error: invalid_request

    How can I get around this?

    1. Hi Jonathan,

      Great question. Gmail is somewhat unique in its API that allows for this specific connection, however you can absolutely use WP Mail SMTP with your Hotmail account — and there are a few ways to do this.

      To use a Hotmail email, you can use either SendGrid, Mailgun, or regular SMTP. You can find links to tutorials on each, as well as more details on SMTP as a whole, in this tutorial.

      I hope that helps! 🙂

    1. Hi Dani,

      Great question. WP Mail SMTP will absolutely work on multisite. To do this you’ll need to network activate, and then configure SMTP for each site individually.

      So for example, after network activating you could follow the steps for Gmail SMTP setup above within the admin area for a specific site within the network (or follow these steps again for additional sites, since Google will require unique details for each domain in the network).

      I hope that helps! 🙂

    1. Hi Mattias,

      Great question, and yes this should still work. When you grant permission for your site to use your Gmail account (Step 3), you should have an additional authentication step (for your 2-factor auth) — but then all tokens should work just the same.

      If you give this a try and have any questions, would you please let us know?

      Thanks! 🙂

  9. Complimenti per la vostra guida, ho seguito tutti i passaggi e non mi sono mai confuso…fossero tutte così le guide!
    Grazie ancora

  10. Hi,
    This is the error message I received with test email:
    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.26
    WP Mail SMTP: 1.1.0

    PHPMailer:
    Mailer: mail

    SMTP Debug:
    [empty]

    When I try to submit a ticket I’m asked to login?

    1. Hi Heidi,

      It looks from your debug log like you may still need to do a couple steps (for example, the ‘Mailer’ should read ‘gmail’). When you have a chance, could you please run back through the steps in the tutorial above and give this another try?

      Hopefully that helps to get this going for you!

      If you have additional questions from there, the best next step is to contact our support in WPForms (if you have a paid WPForms license) or to post in WP Mail SMTP’s support forum. For the fastest support, I’d recommend sharing the debug log as well as any screenshots you’re willing to include of your SMTP settings.

      I hope that helps! 🙂

  11. This was the result. No success

    Versions:
    WordPress: 4.8.3
    WordPress MS: No
    PHP: 5.6.32
    WP Mail SMTP: 1.1.0

    PHPMailer:
    Mailer: gmail

    SMTP Debug:
    [empty]

  12. I’m getting this error:

    Versions:
    WordPress: 4.8.4
    WordPress MS: No
    PHP: 5.6.32
    WP Mail SMTP: 1.1.0

    PHPMailer:
    Mailer: gmail

    SMTP Debug:
    [empty]

    1. Hi there – Gmail is pretty particular, so most often when we see this issue it helps to check back through the tutorial steps on more time (especially Step 3 on enabling permissions).

      If that doesn’t fix the issue, please get in touch our WPForms support or post in the WP Mail SMTP support forum so we can assist further. Thanks!

  13. When I tried to send a test email after properly setting up the plugin according to the instructions on this page, the message returned was not success but rather the following:

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.24
    WP Mail SMTP: 1.1.0

    PHPMailer:
    Mailer: gmail

    SMTP Debug:
    [empty]

    1. Hi Patrick,

      Since Gmail requires such specific setup, the best next step is to run back through the tutorial to check for anything that may have been missed. We’ve seen granting permission in Step 3, for example, being especially common to miss the first time around (for example, here’s a similar issue in the WP Mail SMTP support forum).

      If you give that a try and have any questions, please contact us either in WPForms support or in the WP Mail SMTP support forum. Thanks!

  14. There was a problem while sending a test email.

    The related debugging output is shown below:

    Versions:
    WordPress: 4.7.4
    WordPress MS: Yes
    PHP: 7.1.5
    WP Mail SMTP: 1.1.0

    PHPMailer:
    Mailer: gmail

    SMTP Debug:
    [empty]

  15. Hello

    It is working but then displays my names in the sender. Is there something I can do to make it display my website name as the sender?

    1. Hi Tendai,

      Sure, you can definitely set the From Name in your form emails. First, be sure to set this up in your WP Mail SMTP settings, under Settings > WP Mail SMTP. This will be used if you leave the From Name in your form settings blank, and also for any other emails sent out from your site.

      Then if you’d like to set a different From Name in WPForms, open the form builder and go to Settings > Notifications. If set, the From Email here will override the one in the SMTP settings page.

      I hope that helps! 🙂

  16. Fantastic write-up – worked exactly as you described! Was pulling my hair out trying to get a GoDaddy SMTP configuration working. Google always has to go and make things easier 🙂

  17. Hi, can u help with this error?

    401. That’s an error.

    Error: invalid_client

    The OAuth client was not found.
    Request Details

    response_type=code
    access_type=offline
    client_id= 302355180885-86lp18k21o3af4qm3ka9vd9k1os7n8am.apps.googleusercontent.com
    redirect_uri=https://okcomputerartigas.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    state=
    scope=https://www.googleapis.com/auth/gmail.send
    approval_prompt=force
    include_granted_scopes=true

    1. Hi Marlon,

      I’m sorry to hear you’re seeing issues with this! Here are the next steps I’d recommend: First, checking back through the tutorial to see if anything may have been missed. Then, if you still see the error, trying this other SMTP method to connect to your Gmail account in a different way.

      If you have any questions, please let us know! You can contact our WPForms support here or post in the WP Mail SMTP support forum here. Thanks!

  18. Hi – I followed the instructions above but when I tried the last step of testing I am getting the 500 – Internal server error. Now when I try to access the settings for the WP Mail SMTP plugin I get the same 500 error. I am running WordPress 4.9.1 – This was working for me previously when I used the other method -( Other SMTP provider)
    but stopped working a couple weeks ago. Any help would be appreciated.

    1. Hi Brian,

      The 500 error usually displays when your website has run out of memory. To check into this, I’d recommend doing two things: 1) Setting up your site’s error logs and 2) Contacting your site’s hosting provider to ask if they can increase your site’s memory/address anything else that pops up in the logs (some hosts may be willing to do #1 for you, as well).

      I hope this helps! If you have any questions, please get in touch.

  19. I completed all of the steps above successfully, as well as the test email. However, I still do not get any notification via email that someone has sent in a message via the contact form.

    1. Hi Lisa,

      When we see the test email working, but form emails still not delivering, this is usually a result of notification settings in the form.

      To check this, open the form builder and go to Settings > Notifications. There, the main thing to check is that the From Email matches the email you set up the SMTP with — though it’s also a good idea to check all other settings here (make sure email addresses are formatted properly, etc).

      I hope this helps! If you give this a try and have any questions, please get in touch 🙂

  20. I’m having a Google Error 400 when trying to Authorize the app. This is what it says:

    400. That’s an error.

    Error: invalid_request

    Missing required parameter: client_id

    Learn more

    Request Details
    response_type=code
    redirect_uri=https://www.restaurandome.info/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    client_id=
    scope=https://www.googleapis.com/auth/gmail.send
    access_type=offline
    approval_prompt=force
    include_granted_scopes=true
    That’s all we know.

    Do you know what could be causing this? Thanks

    1. Hi Dan,

      That error says that Google still needs the Client ID, so the best next step is to check that this is in place (top of Step 3). And if it does appear to be filled in, it’d be best to re-copy that value from Google (it may be worth recopying the Client Secret as well).

      I hope this helps! If you give this a shot and have any questions, please get in touch 🙂

      1. I’m having the *exact* same problem as DAN, and my client_id is definitely properly setup on the setting page in WP Mail SMTP, but shows as not being set in the 400 error message in google. In fact this was working last week, but it isn’t anymore.

    1. Hi Rangel,

      If you’re seeing an error from Google, it’s a good idea to go back through the tutorial and check whether any steps were missed (as well as recopying the Client ID and Client Secret). Gmail is pretty picky about settings, so this will generally catch any issues.

      If you give that a try and have any questions, please get in touch! You can contact WPForms support here or post in the WP Mail SMTP support forum here.

  21. Allow-button does not work for me, always getting Google 401 That’s an error. Error: invalid_client. The OAuth client was not found.

    Tried everything, doesn’s work. Please help.

    1. Hi Wim,

      If you’re seeing an invalid_client error, I’d recommend recopying the Client ID and Client Secret from your Google account (see the top of Step 3). It sounds like Google isn’t reading that information successfully, so hopefully that helps.

      If that doesn’t do the trick, it’s a good idea to run back through all steps to check if anything may have been missed since Google requires really specific settings.

      And if you give that a try and have any questions, please get in touch. Thanks!

  22. I cannot get it work using Google G Suite email address.

    Then I even tried the SMTP option but still no luck!

    Can you please help me?

    1. Hi Bin,

      Sorry for the trouble! In order to assist, we’ll need details of any errors you’re seeing. When you get a chance, could you please share those with us here?

      Thanks!

  23. Hello

    Followed all above instructions to setup Gmail, but on final stage to allow plugin to verify next page opens which is Googles and displays this message.

    401. That’s an error.

    Error: invalid_client

    The OAuth client was not found.

    Please advise.

    Thank You

    Ash

    1. Hi Ash,

      The best next step is to double check all the details in your setup (run back through the steps, as well as recopy the Client Secret and Client ID).

      If you give that a try and have any questions, please get in touch 🙂

  24. very nice artical and working

    But My question is little different.

    Do i need to add some lines inside my privacy policy, since i use this method to reachieve and sent massages?
    Kindly give your valuable suggession.
    Thanking You

    1. Hi Nandi,

      That’s a great question. The best way to be certain of compliance is to consult a legal professional, as the rules can vary quite a bit between different locations and the specifics of your site.

      I hope that helps! 🙂

  25. Great instructions, very well layed out. Thank you very much!!

    FYI: I was getting a 401 Error Auth etc.. invalid something something 🙂

    Just make sure to backspace the blank space for your google copied key & secret, thats what was causing me problems..

    1. Hi Val,

      I’m glad this tutorial was helpful for you, and thanks for the tip! It looks like a few others have seen that issue, so we’ll keep that in mind 🙂

  26. Hi there.. Need help i think..
    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 5.5.38
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html

    1. Hi Cenk,

      I’m sorry for the trouble! It looks like your site’s server is missing a certificate needed for SMTP to work. If you contact your site’s hosting provider, they should be able to help (specifically, it seems like your site needs the cacert.pem certificate, though I’d recommend showing them this debug log as well).

      I hope that helps! If you reach out to your site’s host and have any questions, please let us know. Thanks! 🙂

  27. I have followed the directions to install the WP Mail SMTP but when I send the Email Test, I get this message:

    There was a problem while sending a test email. Related debugging output is shown below:
    Versions:
    WordPress: 4.8.1
    WordPress MS: No
    PHP: 5.6.32
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    How do I fix this?

      1. Hi Jess,
        Thanks for responding. The post you directed me to is exactly the same problem I have, down to the unverified site warning page. I did what Slava instructed to fix the problem but had no success. I also deleted the plug-in and reinstalled without success but I have not yet tried to create a new API project credentials yet.

        No emails are going through. Looks like this is an issue affecting more than just me.

        Thanks for any guidance you can provide.

      2. I get the same thing… During the Authorization process, I get a 404 error after allowing google permissions.

        The Javascript redirect is valid if you’re logged in as an admin:
        http:///wp-admin/options-general.php?page=wp-mail-smtp&tab=auth

        That same URI with the authorization for the redirect by Google (like this):
        /wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=4/KDn0VasSDFasdfKE_q35F2G_V6B1QKHJXmQQ-U642Xeg&scope=https://www.googleapis.com/auth/gmail.send#

        Give a 404 on the local website. Thus never authorizes it in the plugin.

      3. Hi Shane,

        I’m sorry for the trouble! SMTP can sometimes run into site/server specific issues, so the details often vary from site to site. When you get a chance, could you please contact our support so we can better assist?

        Thanks! 🙂

    1. Same! [link removed]

      Versions:
      WordPress: 4.9.2
      WordPress MS: No
      PHP: 7.0.22-0ubuntu0.16.04.1
      WP Mail SMTP: 1.2.2

      Params:
      Mailer: gmail
      Constants: No
      Client ID/Secret: Yes
      Auth Code: No
      Access Token: No

      Server:
      OpenSSL: Yes
      PHP.allow_url_fopen: Yes
      PHP.stream_socket_client(): Yes
      PHP.fsockopen(): Yes
      PHP.curl_version(): Yes
      Apache.mod_security: No

      Debug:
      Error while sending via Gmail mailer: {
      “error”: {
      “errors”: [
      {
      “domain”: “global”,
      “reason”: “required”,
      “message”: “Login Required”,
      “locationType”: “header”,
      “location”: “Authorization”
      }
      ],
      “code”: 401,
      “message”: “Login Required”
      }
      }

      1. Hi Marcello,

        If going through Step 3 above once more doesn’t do the trick, could you please get in touch? From there, we’ll be able to collect more details and address this better.

        Thanks! 🙂

  28. Hi
    Thanks for the detailed instructions. It seemed to work all well but there is the following error output. Could you please provide guidance?
    Cheers

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.22-0ubuntu0.16.04.1
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

      1. Hi Jess,

        I am having the same issue as Susan and Alex, even after following the advise to reload the plugin settings page and trying to send several emails it still does not work. I can see in my Google Account it is not listed.

        There was a problem while sending a test email. Related debugging output is shown below:

        Versions:
        WordPress: 4.9.1
        WordPress MS: No
        PHP: 7.0.21
        WP Mail SMTP: 1.2.2

        Params:
        Mailer: gmail
        Constants: No
        Client ID/Secret: Yes
        Auth Code: No
        Access Token: No

        Server:
        OpenSSL: Yes
        PHP.allow_url_fopen: Yes
        PHP.stream_socket_client(): Yes
        PHP.fsockopen(): Yes
        PHP.curl_version(): Yes

        Debug:
        Error while sending via Gmail mailer: {
        “error”: {
        “errors”: [
        {
        “domain”: “global”,
        “reason”: “required”,
        “message”: “Login Required”,
        “locationType”: “header”,
        “location”: “Authorization”
        }
        ],
        “code”: 401,
        “message”: “Login Required”
        }
        }

      2. Hi Nathan,

        Generally when we see the error message you’ve shared, it’s because WP Mail SMTP still needs to be authorized to use your Google account. When you get a chance, would you please check out Step 3 above (specifically the part with the orange authorization button)? And in case it helps, here’s a WP Mail SMTP support thread with this same error and a response from one of our developers.

        I hope this helps! If you give this a try and have any questions, please get in touch 🙂

  29. =========================
    400. That’s an error.

    Error: invalid_request

    Missing required parameter: client_id

    Learn more

    Request Details
    response_type=code
    redirect_uri=https://domain.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    client_id=
    scope=https://www.googleapis.com/auth/gmail.send
    access_type=offline
    approval_prompt=force
    include_granted_scopes=true
    That’s all we know.

    Missing required parameter: client_id

    Learn more

    Request Details
    That’s all we know.
    ============================
    Got Error 400 when trying to allow plugin, I have read above comment and try to remove space but no luck…

    1. Hi Bobby,

      When we see this error, it’s usually because Google isn’t able to see the Client ID. If you’ve already copied that in (under Step 3), could you please try copying it again? Also a common issue is to accidentally copy over whitespace (such as a space after the ID) — so it would be worth checking for that, as well.

      If you give this a shot and have any questions, please get in touch with our support. Thanks! 🙂

    1. Hi akshat,

      The best next step is to double check that the From Name is set. For general email, you can do this in the WP Mail SMTP settings (shown in this screenshot). Or for WPForms, you’ll need to open the form builder and go to Settings > Notifications and set the From Email there (here’s a screenshot of that setting).

      And if the WPForms From Name is left blank, the WP Mail SMTP From Name will be used instead.

      I hope that helps! 🙂

  30. when i tried with gmail smtp i got following error

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.25
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

  31. Hi, I am also getting a 404 error. After I login to the gmail account and click allow, when the instructions above say “Next, you’ll be returned to your WP Mail SMTP settings and a success message will be displayed.” I get returned to my own websites 404 error page. I have played around with the URL and discovered that the issue is with the scope variable. If I enter the url as redirect from google:

    https://www.**********.***/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=CoDeHiDdEnFoRsEcUrItY&scope=https://www.googleapis.com/auth/gmail.send#

    but if I enter take out the last variable and enter:

    https://www.**********.***/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=CoDeHiDdEnFoRsEcUrItY

    I get returned to the plugin page but with the message “There was an error while processing the authentication request. Please try again.”

    Can anyone give me some advice to fix the issue

  32. hi there!

    After I press Allow plugin and choose my gmail account I get the message: “This app isn’t verified”
    When sending a test mail, I get the following error. I see mail instead of gmail, but checked my settings and everything seems to be ok:

    Versions:
    WordPress: 4.7.8
    WordPress MS: No
    PHP: 7.0.24
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    I hope you can help me,

    thanks – Stéphan

  33. Hi Jess Quig,
    Thanks for a great plugin, i used with gmail and it’s working perfect for my client’s website.
    after few day’s client has change the gmail password after that it’s stop working.

    what the process after changing password of gmail.

    1. Hi Webly Digital team,

      That’s definitely odd, as the method from this tutorial shouldn’t be impacted by password changes. When you get a chance, would you please check back through the steps to make sure nothing else might have gotten changed?

      It would also be worth checking the form settings — if the SMTP test email is still working, it may be that the From Email in the form builder needs to be changed to match the email used to set up SMTP.

      If you give these a try and still have questions, please get in touch with our support team and we’ll be happy to assist. Thanks! 🙂

  34. Hi Jess,
    can You give me a hand?
    thx
    Mike

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.0
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    1. Hi Mike,

      Generally when we’ve seen this set of errors, it’s been a result of the site’s server missing a certificate that’s needed for SMTP to work. When you have a chance to reach out to your site’s hosting provider, they should be able to help with this. In case it helps to let them know, it specifically looks like your site needs the cacert.pem certificate (though your host should be able to check to be certain).

      I hope this helps! If you give this a try and have any questions, please get in touch. Thanks! 🙂

  35. Great how-to! Sadly, I run into issues with the last step, I get the following error after I click the “Authorize” button to allow the plugin to send emails using my Google account and select my Google Account I want to send from (it’s a google sites account):

    “Forbidden
    You don’t have permission to access /wp/wp-admin/options-general.php on this server.”

    Thank you for your help!

    1. Hi Johan,

      Generally when we see an error like this, it means that site permissions need to be adjusted so that your user has proper access to make changes. If you contact your site’s hosting provider, they should be to help you with this.

      And if you’d like to try a fix yourself, here’s a tutorial from WPBeginner that should cover all the steps you’d need.

      I hope this helps! If you have any questions, please get in touch 🙂

      1. Hi Jess,

        Thank you for your quick response.
        I’ve set all the folders (and sub-folders) to 755 and all the files to 644, as per the website you linked, but the error is the same.

        I’ll make a support ticket, as the comments here are not the right way to go for clarity, I guess 🙂

        Regards,

        Johan

      2. Hi Johan,

        Thanks for giving that a try! These issues can often be site-specific, so with a ticket we’ll be able to provide more direct and efficient support. Thank you! 🙂

  36. Hi I am getting this error from Google on the last step:

    This app isn’t verified

    This app hasn’t been verified by Google yet. Only proceed if you know and trust the developer.

    If you’re the developer, submit a verification request to remove this screen. Learn more
    Google hasn’t reviewed this app yet and can’t confirm it’s authentic. Unverified apps may pose a threat to your personal data. Learn more

    1. Hi Wendy,

      When we’ve seen this error, it’s generally been a result of a mod_security issue on the server (basically, the site’s server prevents you from granting the permissions needed). The best next step is to contact your site’s hosting provider to ask if they could modify this.

      I hope this helps! If you reach out to your site’s host and have any questions, please get in touch 🙂

  37. Hi, I followed all of these steps, and received the test email successfully.

    My “from” email on the notifications is set to the same email as well.

    However, still no notifications are coming through. Is there anything else I can try?

    Thank you so much for your help!

  38. Could you please help me ?
    I followed all the steps and i got this when i was trying to to confirm the authorization
    401. That’s an error.

    Error: invalid_client

    The OAuth client was not found.
    Request Details

    response_type=code
    access_type=offline
    client_id=716968976876-gcaie0iph72fmaec6mpq1ivj43o644q5.apps.googleusercontent.com
    redirect_uri=https://3core.000webhostapp.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    state=
    scope=https://www.googleapis.com/auth/gmail.send
    approval_prompt=force
    include_granted_scopes=true

    1. Hi Somaya,

      Generally when we see a 401 error, there’s an issue with the Client Secret or Client ID (for example, a common issue is accidentally copying in some whitespace at the end). When you get a chance, could you please recopy these in from your Google account?

      If you give that a try and have any questions, please get in touch 🙂

  39. also i have my own smtp when i set it then try test email then got error phpmailer troublershoot please help
    thank you

    1. Hi Ibrahim,

      Generally when we see this error it means that Google doesn’t see a Client ID in the WP Mail SMTP settings. This can happen if the Client ID hasn’t been copied in yet, or if anything extra got copied into that field (for example, a common issue is accidentally copying in whitespace at the end).

      When you get a chance, would you please try re-copying this value (under Step 3 of this tutorial) to see if that does the trick?

      If you give that a try and have any questions, please get in touch. Thanks! 🙂

  40. Hey there, this is what im getting when i try and send a test email,
    any idea? Thanks a lot.

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.0.26
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

  41. Hello,

    I’m setting up a Gmail account and received the error below when sending a test email. Please let me know how to fix the problem.

    Thanks

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 5.5.38
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    1. Hi Al,

      When we see this error, it generally means that WP Mail SMTP still needs permission to use your Google account. When you get a chance, would you please check that this permission (from Step 3 of this tutorial) has been granted successfully?

      If you give that a shot and have any questions, please get in touch with our support and we can assist further from there. Thanks!

  42. Did this tutorial a first time with my own gmail address and it works fine. But now im trying to change email address i got an error when sending a test mail:

    Versions:
    WordPress: 4.9.1
    WordPress MS: Yes
    PHP: 7.1.11
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Apache.mod_security: No

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “failedPrecondition”,
    “message”: “Bad Request”
    }
    ],
    “code”: 400,
    “message”: “Bad Request”
    }
    }

    How could this been fixed? In the setup I haven’t got any errors.

    1. Hi Stefan,

      Since you’re switching to a new email, the best next step is to delete all SMTP settings and start right back from the beginning of the tutorial. Even if you’ve tried this already, please give this another try. Also, be sure to set up the Google app within this new email account (the From Email and Google app account must match).

      If you give this a shot and have any questions, please get in touch so we can collect more details and assist further.

      Thanks! 🙂

  43. Hi,
    I have followed all the setups and it went well. But on email testing I got the following error.
    Please look into it and advise.

    cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) Error while sending via Gmail mailer: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) Error while sending via Gmail mailer: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    1. Hi Salman,

      Sorry for the trouble! When we see this set of errors, it generally means that your site’s server is missing a certificate required for SMTP to work. To resolve this, you’ll need to reach out to your site’s hosting provider to ask them to install the certificate (your site probably needs a cacert.pem certificate, though host should be able to check to be certain).

      I hope that helps! 🙂

  44. Hello,

    Here is my error. I was previously not able to link my account due to my server’s security system blocking the link. After finally getting that taken care of I thought everything was going to finally work. When trying to send a test email I was hit with this error. Thanks for the help!

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 5.6.30
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    1. Hi Nick,

      Based on that output, it looks like you’re using Other SMTP as your Mailer option rather than the Gmail app approach described above (more details over in this tutorial). If you haven’t already, would you please check out that tutorial to check that all settings are in place?

      Then in order for us to better assist, would you please contact our support team? From there we’ll be able to collect more details and investigate further. Thanks! 🙂

      1. Thanks for the reply Jess! I was using the gmail but you are right that there was another SMTP plug in over riding the one I want to use. I deactivated the other two plug ins and successfully sent a test email! Thanks for your help!

  45. Everything went fine until I tested the e-mail and got this message:

    – – –

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.7
    WordPress MS: No
    PHP: 5.6.18
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    – – –

    Can you help me?

    1. Hi Leandro,

      Usually when we see this error message, it means that authorization still needs to be granted to use your Google account. When you get a chance, could you please double check that Step 3 from the tutorial above is completed?

      If you give this a try and have any questions, please get in touch. Thanks! 🙂

  46. Help….not sure what I can do this is the message I get:

    Email Test
    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.1
    WordPress MS: No
    PHP: 7.1.11
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    1. Hi Diana,

      Generally this 401 “Login Required” error occurs, it’s because authorization still needs to be granted to use your Google account. When you’re able, could you please check that Step 3 has been completed?

      I hope that helps! If you give that a try and have any questions, please get in touch 🙂

  47. I also ran into the “Not Acceptable” error. I contacted my hosting (as suggested above) and the told me that there was nothing that they saw that was out of line. Do you have any suggestions. Thanks for your time!

      1. Hi,

        I am also running into this error below. What can I do?

        Not Acceptable!
        An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

      2. Hi Jessica,

        If you’re seeing a Mod_Security error, you’ll need to contact your site’s host (this error is a result of server settings). They should be able to identify the rules within Mod_Security that need to be adjusted for SMTP to work.

        I hope that helps! 🙂

  48. Thanks, looks good! Others might have mentioned this, but Google warned me they didn’t know the developer and hadn’t verified it and to only go forward if I trusted the company. I overrode it, but I figured I would let you know.

    Thanks again!

  49. Hello, I have taken all steps and allowed in GSuite (step 3) & got this message: You have successfully linked the current site with you Google API project. Now you can start sending emails through Google..

    But when I sent test email, I kept getting this error:
    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 5.6.33
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Apache.mod_security: No

  50. Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 5.6.33
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

  51. Thanks For this plugin but it appears that there is a known issue with the Redirection back to the WordPress admin site after clicking “ALLOW” on Google just after clicking on “Allow plugin to send emails using your Google account” button.

    The redirection back to the website fails and for me it redirects to the custom 404 Not Found page that I have set through my theme.

    I see so many comments above on the exact same issue and people pointing to the plugin or hosting issues. I am not sure.

    The worst part is that I get a success response for sending test email but the email never comes.

    Do we have a remedy for this as yet?

    1. Hi Shyam,

      Most of these issues stem back to server-related issues, which vary by hosting provider, as well as other factors. We just released an update for WP Mail SMTP that should resolve most of the issues we were seeing, though — when you get a chance, would you please check that this latest version (1.2.3) is installed?

      If you run that update, go through these steps once more, and still have questions please get in touch. We’ll be able to assist further from there 🙂

  52. I’m getting an error when I try and test.

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 7.1.13
    WP Mail SMTP: 1.2.3

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 77: error setting certificate verify locations:
    CAfile: C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    1. Hi Mark,

      It looks like a similar issue was posted in the WP Mail SMTP forum. The folder structure suggests this is a local site, so if that’s correct you’ll need to check into the documentation for your local setup to find out how to add the certificate mentioned in this log (cacert.pem).

      For any issues like this on regular (non-local) sites, the hosting provider should be able to install the certificate.

      I hope that helps! 🙂

  53. I am having the same problem with being redirected to my site’s 404 page on the last step after authorizing the plugin and logging into Google. My plugin is up to date on Version 1.2.3.

    Any suggestions on how to fix this? Thanks!!

      1. We use the WP Mail SMTP plugin, so I don’t have an account with WP Forms in order to create a support ticket. How would I get in touch to get this issue resolved? Thanks!

  54. A strange problem: I set up all the configuration to use Gmail SMTP creating an app for that, and put the credentials on the plugin.
    The test mail works but when I try to register as a new user, no mail is sent.

    1. Hi Andrew,

      When the test email works but the form emails still don’t come through, this is usually a result of a From Email issue. When you get a chance, try opening your form builder and going to Settings > Notifications. On that panel, check that the From Email is the same email address you used to set up SMTP.

      You can always change the Reply-To email to a different email address, but the From Email has to match for the SMTP to work.

      I hope that helps! 🙂

  55. Hello everyone, can you please help me with this?

    I have version 1.2.3

    when clicking on the authorization for gmail this appears:

    Not Acceptable!

    An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

    Thank

    1. Hi Camilo,

      This error means that there’s an issue with Mod_Security on your site’s server (likely some rules in this module are preventing the SMTP from working). In order to resolve this, you’ll need to contact your site’s hosting provider — they should be able to resolve this for you (they can check the server logs for additional details).

      I hope that helps! 🙂

  56. What’s up everyone!!!

    Everything good! good looking plugin!

    They recommended me this plugin and it works great except, all my emails still go to junk mail, anyone else experiencing that?

  57. Hi Jess, this works great! Quick question about the From Email / From Name. I have those configured in the app, but the emails just show my default email for Gmail, *not* WordPress or wordpress@mydomain.com. Is there a way to show the fields I have entered?

    1. Hi Sean,

      Sure, sorry about the confusion on that! When using an SMTP, the From Email must always match the email you set up the SMTP with — without that, the SMTP can’t work. This means that if you set up this Gmail SMTP option, you must use that same Gmail or G Suite email address as the From Email — both in the SMTP settings and in your forms.

      From what you mentioned, it sounds like you probably have a different From Email set in your SMTP settings and in your form settings. When you get a chance, try making all three of these emails match (the email used to set up the SMTP, the From Email in the SMTP settings, and the From Email in your form notification settings). That should resolve any odd issues you’re currently seeing.

      I hope this helps! If you give this a try and have any questions, please get in touch 🙂

  58. Hi, thank you for this step by step tuto. I managed to go through all the steps. I received my test email. However my contact form is still not working. Which setting should I have to put in my contact form 7? I understood that if mails wasn’t working theought contact form, by setting your plugin this will resolve the problems but I think I am missing something. Thank you in advance for your help.

    1. Hi Claire,

      If the SMTP test email is working but form emails are still not delivering, you’ll need to check your notification settings. In the form, be sure the From Email is set to the same email you used to set up the SMTP — these must always match for the SMTP to work.

      I hope that helps! 🙂

  59. Hello
    When you test this email, it does?

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 5.6.33
    WP Mail SMTP: 1.2.4

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: No
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    Please copy only the content of the error debug message above, identified with an orange left border, into the support forum topic if you experience any issues

    1. Hi Amir,

      The first thing to check is that WP Mail SMTP is fully updated on your site (we recently resolved some issues along these lines). Next, be sure to check back through Step 3 in the tutorial above, as you’ll need to provide authorization for the SMTP to use your Google account.

      I hope that helps! If you try both of these steps and still have any questions, please get in touch 🙂

  60. It works great. but thing is in the mail while i clicked the little arrow to see from, to, date, subject, security, signed-by. everything shows correct except signed-by. its not showing the proper domain on signed-by. it must be the exact domain name.

    Thanks.

    1. Hi Rezaur,

      The best next step is to check that WP Mail SMTP is fully updated, then go back through the tutorial to be sure that no parts may have been skipped.

      If you try both of these and still encounter this same error, you’ll need to reach out to your site’s hosting provider. Though they will hopefully have server logs with additional information, they’ll likely need to check on mod_security settings to see if any rules are blocking the SMTP from working (and in case it helps, the end of this support thread for WP Mail SMTP appears to be describing the same issue and recommendation from one of our developers).

      I hope that helps! 🙂

  61. Also got this when try to test email

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 7.1.12
    WP Mail SMTP: 1.2.4

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

  62. st
    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 5.5.22
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    I allowed WP forms plugin to send email using my Gmail account, still getting errors.

    1. Hi Hrishikesh,

      When you get a chance, could you please check that WP Mail SMTP is fully updated on your site? We recently released an update that should resolve this issue in most cases.

      If you check on that and still see any issues, please let us know 🙂

  63. Any idea what this error could mean?

    Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setClassMapAuthoritative() in /home3/rj6ddh4o/public_html/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php on line 38

    1. Hi James,

      I’m not familiar with that error, so I suspect it’s related to something fairly site-specific (possibly server configuration, etc). In order to better assist, could you please get in touch? From there, we’ll be able to collect more details and investigate further.

      Thanks! 🙂

  64. I got this error message:

    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 7.0.27
    WP Mail SMTP: 1.2.4

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    How to fix this??? (thank you 🙂

    1. Hi Bryan,

      Since Gmail SMTP setup is somewhat complex and relies on a lot of exact settings, the best next step is to run back through the tutorial to see if anything may have been missed (so repeat each step, recopy the keys, etc).

      If you give that a try and have any questions, please let us know!

      1. I swear I’ve gone through the tutorial and executed beautifully a few times now … still ain’t working. Same error code. What do you recommend?

      2. Hi Bryan,

        In that case, you’re almost certainly encountering issues from your site’s server. The best next step is to contact your site’s hosting provider to ask them to investigate this further.

        If you still have questions from there, please share any available details in the WP Mail SMTP support forum.

  65. The following is the error message I am getting when sending a test email. Can you tell me what the problem is?

    Versions:
    WordPress: 4.9.2
    WordPress MS: No
    PHP: 7.0.27
    WP Mail SMTP: 1.2.4

    Params:
    Mailer: mail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: No
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    1. Hi Cheryl,

      Based on that debug log, it appears that you still need to authorize access to your Google account. When you get a chance, could you please repeat Step 3 in the tutorial above to see if that does the trick?

      Thanks!

      1. Hi Jess –

        We went through Step 3 of the tutorial again and below is the error message that we are getting now (both Auth Code and Access Token are now “Yes” while before they were “No”). I am noticing that under Params, the Mailer is set to “gmail” for a lot of people while for us it is “mail”. Should ours say “gmail”?

        Versions:
        WordPress: 4.9.2
        WordPress MS: No
        PHP: 7.0.27
        WP Mail SMTP: 1.2.4

        Params:
        Mailer: mail
        Constants: No
        Client ID/Secret: Yes
        Auth Code: Yes
        Access Token: Yes

        Server:
        OpenSSL: Yes
        PHP.allow_url_fopen: Yes
        PHP.stream_socket_client(): Yes
        PHP.fsockopen(): Yes
        PHP.curl_version(): Yes

      2. Hi Cheryl,

        If you’ve given all of this a try and are still seeing issues, you’re likely running up against server issues. Some hosting providers have their servers configured in ways that prevent SMTP from working properly/communicating properly with Google.

        The best next step is to reach out to your site’s hosting provider and ask them to check for anything that may be blocking SMTP from working. While it’s tough to be more specific from our end, they should be able to access server logs and see more details.

        I hope they’re able to help you get this sorted! If you get in touch with your site’s host and still have any questions, please share those in the WP Mail SMTP support forum. Thanks!

    1. Hi Kalsoom,

      If you’re seeing this error, there was most likely an accidental copy-paste issue somewhere along the line.

      The best next step is to go back through the steps and redo any part where values had to be either typed in or copy/pasted (though best to check all steps & settings to be completely sure). For example, if there’s any minor typo or even extra whitespace (like a space at the end of copied text), this will cause an error – but unfortunately the best way to fix this is to go back through each step.

      I hope this helps!

    1. Hi Cheryl,

      Great question. If you’re already using the SendGrid plugin, there shouldn’t be any need to install an additional SMTP plugin. SMTP will apply to all emails sent out from your site (for all form plugins, WordPress emails, etc), so once you’ve set it up once you’re all set.

      However, if you do want to set up WP Mail SMTP’s Gmail option, be sure to disable the other SendGrid plugin first. When more than one SMTP plugin is active on a site, they tend to break each other’s functionality (since they’re trying to do the same things).

      Last, no matter what SMTP you use be sure to check your form notification settings. As noted in the tutorial, the From Email in your form’s notification emails must always be the same as the email that you’ve set up the SMTP with.

      I hope this helps! 🙂

  66. I’m getting the following error

    HTTP Error 403 – Forbidden

    The Web server is configured to not list the contents of this directory or you do not have enough permissions to access the resource

    Could you please provide me a solution i have tried out several times but getting the same error

    1. Hi Naren,

      It sounds like you’re encountering an issue’s with your site’s server. Most likely, there are security measures in place that are preventing you from setting up SMTP. In order to resolve this, you’ll need to reach out to your site’s hosting provider. They can check your site’s server logs to help determine what needs to be altered to allow you to set this up.

      Hopefully they’re able to resolve this quickly for you. However, if you still have questions after giving that a try, please share any details in WP Mail SMTP’s support forum. Thanks! 🙂

      1. Hi !

        Im getting the same error message as Neran HTTP Error 403 – Forbidden.

        I have contacted my host and they can’t find a reason for this error. Do you have any other solutions?

        Regards
        Meg

      2. Hi Meg,

        It sounds like there’s most likely a security-related issue causing this. I took a look at WP Mail SMTP’s support forum and found this post that seems to describe a similar issue.

        Hopefully the details shared in that post help you out, and help to point your site’s host in the right direction! If you have any additional questions after giving those recommendations a try, please post the issue (along with any possible details, what you’ve tried so far, etc) in the WP Mail SMTP forum. Thanks!

  67. So, in order to get this to work for my MULTIPLE clients, I have to have each of them involved in the process to authenticate?

    There’s no way to set this up on their behalf without having their google account info?

    is that correct?

    1. Hi Rob,

      If you’re setting up SMTP on multiple sites, each site will have to be configured separately. While I understand any frustration with the time needed for this, SMTP will authenticate using the details for a specific site and email address – so the setup is necessarily separate for each site.

      Fortunately, once this is all set up for a site you should be totally set (no need to make additional changes) 🙂

  68. Hi there,

    I followed all instructions and received the following debug error code:

    cURL error 77: error setting certificate verify locations:
    CAfile: C:\Plesk\Additional\PHPSettings\cacert.pem

    I have contacted my web host and asked them to install the cacert.pem certificate however they said that it is a shared hosting server and they are unable to move it.

    They have provided the location of the certificate, but it is not located where the plugin is looking for it.

    My question is, how to I tell the plugin to find the cacert.pem file in a different location? Is this in my wordpress settings?

    Thanks in advance,

    Josh

    1. Hi Josh,

      Unfortunately it sounds like your host’s server has a configuration issue. Essentially, the error you’re seeing means that the server itself isn’t seeing the certificate (so our plugin is reading the error off of the server).

      This certificate is needed to verify any communication with sites running on https. In the case of WP Mail SMTP, for example, it needs to be able to communicate with https://mail.google.com. However, this functionality is needed for many other purposes and is likely to cause additional issues as you continue to build your site. Because of this, your hosting provider will hopefully be willing to resolve this configuration issue fully for you so that the server can properly read the certificate.

      I apologize that there isn’t more we’re able to do to assist with this, but hopefully this helps!

  69. Hi, I’ve tried it several times to configure but im still getting this error.

    Debug:
    Error while sending via Gmail mailer: { “error”: { “errors”: [ { “domain”: “global”, “reason”: “failedPrecondition”, “message”: “Bad Request” } ], “code”: 400, “message”: “Bad Request” } }

    Pls help me out.

    1. Hi Yoki,

      I’m not familiar with this error, but it looks like there may be an issue in the settings. I apologize as I can definitely understand any frustration, but the best way to be certain is to carefully go through each step in the tutorial again (recopy all details, etc).

      If you give this a try and still see this error or have questions, please let us know in the support forum for WP Mail SMTP. Thanks!

  70. Hey! I am getting error with this:

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 5.6.31
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: smtp
    Constants: Yes
    ErrorInfo: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    Host: md-in-81.webhostbox.net
    Port: 465
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true)

    Server:
    OpenSSL: Yes
    Apache.mod_security: No
    SMTP Debug:
    2018-02-10 01:47:35 Connection: opening to md-in-81.webhostbox.net:465, timeout=300, options=array (
    )
    2018-02-10 01:47:35 Connection: opened
    2018-02-10 01:49:35 SERVER -> CLIENT:
    2018-02-10 01:49:35 SMTP NOTICE: EOF caught while checking if connected
    2018-02-10 01:49:35 Connection: closed
    2018-02-10 01:49:35 SMTP Error: Could not connect to SMTP host.
    2018-02-10 01:49:35 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    1. Hi Shashank,

      It looks like these settings are for our ‘Other SMTP’ mailer option, rather than Gmail (this tutorial). When you get a chance, could you please try out our Other SMTP tutorial?

      If you give that a try and still see this error, the best next thing to check is that your host and port are correct. I’m not familiar with the option you’re using, but you can contact your email provider (or wherever this email is hosted) to confirm.

      And if you try each of these things and still see an error, I’d recommend 2 additional steps: 1) Contact your site’s hosting provider to see if they do anything that could block SMTP 2) After trying #1, post to the WP Mail SMTP forum (including any details such as what you’ve tried so far, your current error log, etc).

      I hope this helps! 🙂

  71. Hi, followed the instructions and received this message when I clicked to authorize –

    401. That’s an error.

    Error: invalid_client
    The OAuth client was not found.
    Request Details
    That’s all we know.

    Thanks in advance for any assistance

    Regards

    Andrew

    1. Hi Andrew,

      If you’re seeing this error, most likely Google isn’t able to read the Client ID or Client Secret properly. The best next step is to try copying these details again (be sure to exclude any whitespace, etc).

      And if you give this a try and still have any questions, please share any details (the error you see and anything you’ve tried) in the WP Mail SMTP support forum. Thanks!

  72. Hi!

    I am getting this message but I am not sure what is the problem

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.0.27
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “invalidArgument”,
    “message”: “Recipient address required”
    }
    ],
    “code”: 400,
    “message”: “Recipient address required”
    }
    }

    1. Hi Shawn,

      I can’t say I’ve seen this particular error before, but my recommendation would be to go back through the tutorial on more time just in case anything may have been missed (go back through each step, recopy all keys, etc).

      If you give that a try and still see this error, please get in touch! Thanks 🙂

  73. Hi

    My developer configured WP Mail SMTP with Gmail domain mail using Client ID and Client Secret information.

    I now need to change my gmail password for security. Am I correct in thinking that I will not need to reconfigure WP Mail SMTP please, because of the way that it is set up?

    1. Hi Selina,

      Yes, that’s correct! This is one of the things that makes this API approach so great — it doesn’t involve your Gmail password, so you won’t need to modify your SMTP setup in any way when you do a Gmail password reset. 🙂

  74. Please help me out with my problem:

    Versions:
    WordPress: 4.8.5
    WordPress MS: No
    PHP: 7.0.27-1~dotdeb+8.1
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: Yes

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes
    Please copy only the content of the erro

    1. Hi Richard,

      I’m sorry to hear this SMTP isn’t working for you yet. The best next step is to check through the tutorial to be certain that nothing might have been missed. If you give that a try and still see any issues, please share those (and any additional details, such as what you’ve tried so far, whether you’ve contact your site’s hosting provider for assistance, etc) within the WP Mail SMTP forum.

      Thanks!

  75. I keep getting this error even though I’ve doublechecked everything and granted permission.
    Debug:
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }

    1. Hi Donna,

      We recently released an update that may help with this issue. When you have a chance, could you please check if any updates are available (under Dashboard > Updates)? If there is an update, please go ahead and run that then give the permissions step another try. If there isn’t an update available, please get in touch. We’ll be able to collect more details from there and better assist.

      Thanks!

  76. I keep getting 401 thats an error and its Feb 13 9PM. The plugin is up to date. This has been going on for far too long. I cannot use the plugin.
    I have tried copy and paste the client ID and Secret many different ways, double checked for extra space before and aafter the id’s but nothing changes.
    grrrrr………

    1. Hi Brian,

      I’m sorry for the trouble with that, and it’s certainly possible that there’s a separate issue occurring. The best next steps are: 1) If your site has any other SMTP plugins, deactivate them. It may also help to deactivate any caching plugins (be sure to clear their caches first). Then if you still see an error, 2) Go back through this tutorial once again (redo each step) to be certain that nothing could have been missed.

      In case it helps, I found a similar error in a WP Mail SMTP forum thread that shares similar details. Our developer also suggests there checking for any other plugins that might use the Google API, so that may be a good idea as well.

      I hope this helps! If you give this a try and have any questions, please share all available details in the WP Mail SMTP support forum. Thanks!

  77. I have gone through all of the steps, but now when I try to send a test email it takes me to a screen that says:

    This page isn’t working
    xxx.com is currently unable to handle this request.
    HTTP ERROR 500

    (I replaced my site url with the xxx)

    I had some trouble at the step of “Allow plugin to send emails using your Google account”, but I was able to paste the client id into the url and get to the authorization screen. What could be going wrong here?

    1. Hi Heather,

      I’m sorry to hear that SMTP isn’t working for you yet. When we see issues like this, the best next step is to run back through the tutorial to be certain that nothing might have been missed (redo each step, recopy details, etc).

      If you give that a try and still see any issues, the best next step is to contact your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your support should be able to help resolve (they can check server logs to see details on that error).

      And if you currently have/decide to purchase a paid license for WPForms, our support can certainly assist further. Thanks!

  78. Hi there:
    I successfully set the application up (ppphew…so much work for a beginner)!!!
    My test emails worked. Question:
    How does this affect the receiving of comments and emails from my blog by READERS WHO MAKE COMMENTS that use another email application other than G mail??
    What if somebody makes a comment who uses Yahoo or AOL or any other than G mail.?
    Will I still be notified or not?
    thanks Howard

    1. Hi Howard,

      Fortunately, SMTP doesn’t alter requirements for the recipients of emails in any way. So while all emails from your site will now be sent from your Gmail/G Suite email address, absolutely any email address can receive those emails.

      I hope this helps! 🙂

  79. This works for me. Thanks for the great tutorial.
    One question… When I receive the emails there are security warnings:

    Question Mark next to myname@mydomain.com with a popup message that says “Gmail couldn’t verify that mydomain.com actually sent this message (and not a spammer)” – this is on both the message I receive and the message the sender receives after completing the form.

    This email claims to come from mydomain.com, but replies will go to an email address at another domain. -This is on the email notification I get about a new form submission.

    Will the messages always display these security warnings? Not a big deal for the ones I receive, but I don’t want to spook my clients. 🙂

    1. Hi Heidi,

      If you’re seeing this notice, it sound like the From Email (set in the form builder under Settings > Notifications) may not match the Gmail account that SMTP was set up with. If you make these match, Gmail should remove this notice.

      Hope that helps! 🙂

  80. Hi, it works for me, all emails are successuly sended
    but recipient of emails is the gmail account.
    I tried a lot of options, but not lucky

    Thanks for your plugin.

  81. Great Plugin. Took a while to get it set up but now I can send emails using my Gmail account. Couple of stupid questions for you…

    1. Where do I set up lists?
    2. How do I create HTML emails?

    Do I need another plugin for that? Is there one you recommend? Thanks!

    1. Hi Jeanne,

      I apologize for any confusion, and SMTP is only able to help the emails from other plugins/services to deliver successfully (not to send emails itself, other than the test email). There are tons of plugins that send out emails for various purposes, including our own — WPForms.

      To set up a mailing list with our forms, you would need to integrate with a marketing service (Constant Contact, MailChimp, etc). Then, anytime a user submits one of your forms you could automatically add them to your mailing lists within that marketing service.

      We have a number of marketing service integrations available, but here’s a tutorial showing how to use our MailChimp addon, a super popular option.

      Also, HTML emails are the default WPForms (and what MailChimp uses as well).

      I hope this helps! If you have any other questions, please feel welcome to get in touch 🙂

  82. Great job on the plugin and the detailed tutorial.

    I can send email using G Suite and they don’t end up in people’s spam folders. However, no matter what email address I use in the plugin’s “From:” field, it doesn’t get used. When sending a test email, what appears in the “From:” field of actual email received is my primary email address from G Suite. This primary email is not set any where in WordPress.

    I deactivated the plugin and sent some test email using another plugin (Check Mail). The sent email does have the “From:” field of the email address from Settings / General / Email Address field with “WordPress” along with it. This is sometimes marked as spam though.

    1. Hi Thomas,

      In order for SMTP to work properly, you’ll need to use the same email in 3 places:

      1) When you set up the API (you’ll need to be logged into this email address)
      2) The From Email under Settings > WP Mail SMTP
      3) The From Email in your forms plugin (in WPForms, you can find this in the form builder under Settings > Notifications)

      If all of these are in place, and the test email is successful, you should be good to go.

      I hope this helps! 🙂

  83. Hi, Jess
    I have a problem with sending e-mail.
    Could you please help me?

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.0.16
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No
    Client ID/Secret: Yes
    Auth Code: Yes
    Access Token: No

    Server:
    OpenSSL: Yes
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): Yes

    1. Hi Sinan,

      I’m sorry to hear that SMTP isn’t working for you yet. As the next step, I’d recommend checking your plugins to make sure no other SMTP plugin is active on the site (they tend to break one another since they serve the same function). From there, the best next step is to run back through the tutorial to be certain that nothing might have been missed (redo each step, recopy details, etc).

      If you give that a try and still see any issues, the best following step is to contact your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      And if you currently have/decide to purchase a paid license for WPForms, our support can certainly assist further. Thanks!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.