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 into your Gmail account 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!

      4. The fact that there’s a “Logout” in the URL in the article isn’t a cookies issue, and it’s *very* frustrating that it signed me out of all my google accounts.

        Could you update the URL to… you know… not log everyone who follows it out?

      5. Hi Sam,

        Thanks for pointing that out, and I apologize for the trouble! We’ve fixed this link so that it now points directly to the app creation page. Thanks again for letting us know!

  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! 🙂

      3. I am receiving the following error on the wp mail smtp plugin. i am unable to submit a ticket as i am a webmaster for a website.

        Versions:
        WordPress: 4.9.4
        WordPress MS: No
        PHP: 5.5.38
        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

        thanks shay

      4. Hi Shay,

        Generally when there aren’t any extra debug details printed underneath the content you shared, this means that there’s another SMTP plugin active on the site (the conflict between the two can prevent the full debug message from displaying, as well as prevent the SMTP connection from working). The best next step is to check for and deactivate any other SMTP plugins on the site.

        If you give that a try and still see any issues, generally the next best thing to try is contacting your site’s hosting provider. As a whole, 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!

      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. Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.1.12
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: No

    Debug:
    There was a problem while retrieving Mailer for gmail: Could not json decode the token
    There was a problem while retrieving Mailer for gmail: Could not json decode the token
    There was a problem while retrieving Mailer for gmail: Could not json decode the token
    There was a problem while retrieving Mailer for gmail: Could not json decode the token
    There was a problem while retrieving Mailer for gmail: Could not json decode the token

      1. Hi Jess, I see that you suggested that another user with the same “Could not json decode the token” problem fill out a support form, however, support requests are for WPForms buyers only, how do I send you one for WP Mail SMTP?

      2. Hi Michael,

        If you could please contact us via the right-hand option on our Contact page (‘Complete a Form’) button (and please mention that I asked you to get in touch), that will help us to troubleshoot this issue with you.

        Thanks!

      1. Hi Twan,

        I see from a ticket you submitted to our support that you were able to resolve this issue. In case it helps anyone else, it looks like you found a conflict with Post Duplicator.

        Thanks for letting us know! 🙂

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

  83. 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! 🙂

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

      1. HI, I have the same problem as Sinan.

        Mailing was OK before a few weeks, but now it doesn´t works.

        When I try to send a test e-mail, there is this error message:

        Versions:
        WordPress: 4.9.4
        WordPress MS: No
        PHP: 7.0.27-0+deb9u1
        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”: “invalid_grant”,
        “error_description”: “Token has been expired or revoked.”
        }

        Thank you for your help…

        Regards,
        Micek

      2. Hi Micek,

        From this error message, it sounds like you’ll need to regenerate the Client ID and Client Secret. When you get a chance, could you please repeat the steps from this tutorial to create new values for each of these, add those to the WP Mail SMTP settings, and see if that fixes the issue?

        Thanks!

  85. How do I add more than 1 email? I’ve successfully set up the gmail smtp but now all auto replies from my site come only from the one email address I set up instead of the 3 or so that I have set up depending what contact form they submitted (info@, marketing@, franchsiing@ etc.

    Thanks

    1. Hi Chris,

      I apologize, however in order for SMTP to work the From Email will always need to be set to the same email you set up the SMTP plugin with. In case it helps, however, you can set the Reply-To email to any email address you’d like. That way, if a user replies they’ll contact the relevant email.

      In WPForms, you can find this in the form builder under Settings > Notifications (here’s a screenshot).

      Hope this helps! 🙂

  86. Hi connected with a Gsuites account but all emails are sent from the main admin address in Gsuites. I chose another email of this gsuites account in the plugin settings but it is ignored. How can I send from another email (which is also part of the gsuite account of course)?

    1. Hi Liibooz,

      In order for SMTP to work, the From Email must unfortunately always be exactly the same as the email used to set up SMTP. In case it helps, however, you can set the Reply-To email to any email address you’d like. That way, if a user replies they’ll contact the relevant email.

      In WPForms, you can find this in the form builder under Settings > Notifications (here’s a screenshot).

      Hope this helps! 🙂

    1. Hi Boyer,

      This is definitely possible, however you would need to set up the SMTP plugin with settings for hello@mydomain.com. If you use G Suite for your email, you can even use this same Gmail SMTP option.

      If this email address uses any other email provider, however, you’ll need to use a different SMTP option. SendGrid and Mailgun are the most secure options, though they require a bit more setup, and basic SMTP is a less secure option with generally faster setup.

      However, any of these options will work with any email address (no Gmail required), and you can follow those links for step-by-step tutorials on each.

      I hope this helps! 🙂

  87. Hi,

    Great plugin.

    But for some reason, some time to time, emails are not sent
    in that case, I have a message coming back with the error message coming back


    SMTP error from remote mail server after end of data:
    550 Messages should have one or no To headers, not 2.

    The email adress is ok though (I tried it on one of my personnal email adress)

    What can I do to fix this ?

    1. Hi Alex,

      I’m sorry for the trouble with that. In order to help address this issue, we’d like to collect some additional details from you. When you have a chance, could you please contact us (right-side form here, and please mention that I asked you to get in touch).

      Thanks!

  88. HI, it works, but all emails send out, received by customers, get a warning attached, stating that this email may not be send out by the original email account…. how can i solve that?

    Kind reg
    js

    1. Hi Jeroen,

      I have a couple recommendations of things to check to remove that warning:

      1) Make sure that the From Email in the WP Mail SMTP settings matches the email used to set up the Gmail app.
      2) If you’re using any plugin that send email (such as WPForms), make sure the From Email in those plugin settings also matches the email used to set up the Gmail app.

      This should prevent a mismatch and allow the Google API to work properly (removing the warning). And if you give this a try and have any questions, we provide limited support through the WordPress.org plugin forums. If you could share any details in a thread there (the issue, what you’ve tried, screenshots of settings if possible, etc), that helps us to more quickly investigate as well.

      Thanks!

  89. I have a recurring problem with several gmail accounts that I can not configure with WPForms smtp. I still have a 400 error when I finish the settings and yet I copied the client ID without space … is there a particular setting?

    1. Hi Gentil,

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

    1. Hi Fe,

      In order to be sure that the From Name/From Email are set how you’d like, you’ll need to check that these settings are the same in a few places:

      – WP Mail SMTP settings (Settings > WP Mail SMTP)
      – The Gmail account (so make sure that the email you used to set up the Google App is the same you used as the From Email)
      – Any plugin that sends email (for WPForms, you’d need to set the From Name and From Email in the form builder under Settings > Notifications)

      I hope this helps! 🙂

  90. Hi, the debugger shows [empty] – what does this mean and how do I fix this?

    There was a problem while sending a test email.

    The related debugging output is shown below:

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

    PHPMailer:
    Mailer: gmail

    SMTP Debug:
    [empty]

    1. Hi Jenny,

      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). It would also be worth checking through your active plugins and deactivating any others related to SMTP (they generally conflict with one another).

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

    1. Hi Joshua,

      Great question. If you’d like to use an email such as me@mydomain.com as your From Email, you’ll need to use that email to set up SMTP (the From Email must always be the same as the email you set SMTP up with). In case it helps, though, any of the other mailer options will work with any email (not just Gmail/G Suite emails).

      I hope this helps! 🙂

  91. I get this error message when trying to send email via G-Suite:

    There was a problem while retrieving Mailer for gmail: Could not json decode the token

    I have verified that all my settings are correct by going through set up again. The only thing I can think of is that I should have put my G-Suite email address in the “From” field (but the form implies it’s optional).

    But now due to fatal errors, your control panel won’t let me change settings. Is that correct? I deleted the plugin but after reinstalling it, I got the same pre-filled fields issue.

  92. Hi,
    We get the following error by testing the e-mail. Can you help?

    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”: “failedPrecondition”,
    “message”: “Mail service not enabled”
    }
    ],
    “code”: 400,
    “message”: “Mail service not enabled”
    }
    }

    Thanks!

    1. Hi Tanja,

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

  93. I’m trying to set up the WP Mail SMTP widget, I have the first half of the form completed, but I’m not sure how to proceed in the second half where the associated gmail account credentials should be answered. I built this website for my client, therefore the emails would go to her email address. I don’t feel comfortable asking for her login credentials. How can I proceed? Thanks!

    1. Hi Mariel,

      Unfortunately it’s not possible to set this up without email logins, as you’ll need to use the From Email to set up the Google App. So while you can send out emails to any email you’d like, the From Email (both in WP Mail SMTP settings and in your forms) must match the email you use to set up the app details.

      I hope this helps provide some clarification! 🙂

  94. A long and winding road! What a drama just to post an email. You’d think somebody was trying to make it as difficult as possible?
    Done it anyways thanks to your step by step guidance. All working and tested.

    1. Hi Neil,

      I apologize for any trouble. Email delivery can definitely be a frustrating issue, though I’m glad our guide and plugin were able to help! 🙂

    1. Hi Jess,

      I apologize as I’m not familiar with this error, but generally the best next step is to run back through the tutorial to try and catch any step than may have been missed (and recopy Client Secret, etc).

      If you repeat these tutorial steps and still see the same error, could you please let us know? Thanks!

  95. Jess,
    I want to commend you on replying on so many comments and being so helpful and would like to post what worked for me.
    I too was getting the Mod_Security error when trying to authorize for google:
    “Not Acceptable!
    An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.”

    My hostgator tech support chat rep eventually checked the logs and simply white listed my ip address so I could authorize my domain to send emails on my behalf. I’m not sure if that is the best practice but that is what he did and it may help someone else with explaining the problem.

    1. Hi Shane,

      Thanks for sharing that! It’s definitely useful for us to hear what a specific host can do to fix errors like this, and I’m glad to hear that in the end it was a quick fix.

      Thanks for taking the time to pass this along! 🙂

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

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 5.6.33
    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

    Debug:
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\Program Files (x86)\Parallels\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)\Parallels\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)\Parallels\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)\Parallels\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)\Parallels\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)\Parallels\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)\Parallels\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)\Parallels\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    1. Hi Sam,

      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 this helps!

      1. Thank you so much for the help! Sorry for still bothering you, but how exactly would I do this? Still a little unfamiliar with WordPress.

  97. Hello, I get all the way to Step 3 when I need to click the allow button. When I do that, I get an “opps, that page cannot be be found” message. It says the latest version of the plugin has been installed.

    1. Hi Jodi,

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

  98. These instructions worked for me. Thank you so much. I was able to successfully send contact form information to my e-mail.

  99. Hello, first congratulations for the tutorial, it’s perfect
    I have installed your plugin and created the Google Suite’s Console API following your steeps.
    But my problem still it’s….
    With plugin contact form 7, when I send a email it is always loading, never appears the message “thanks for your message”
    Could you help me with this ?

    1. Hi Marc,

      As long as the test email (under Settings > WP Mail SMTP > Test Email) is successful, SMTP is completely good to go. In this case, you’d need to get in touch with your contact form’s support team to find out what the issue is on their end.

      Thanks!

    1. Hi Tori,

      It sounds like the Authorized Redirect URI isn’t matching correctly. Could you please try recopying that from your site (under Settings > WP Mail SMTP) into your Google App? The best method is to use the copy button shown in this screenshot.

      If that doesn’t do the trick, the best next step will be to run back through each step in this tutorial (redo steps, recopy info, etc) to make sure nothing may have been missed.

      I hope this helps!

  100. I am getting this error

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

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 5.6.30
    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

    1. Hi Vineet,

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

  101. hi there;
    am using you wpform pluging. the wp mail SMTP is sending the test mail and all ok. but when i try to send an email from wpform i do receive nothing. am having multiple emails in information section. any idea or help about this subject

    1. Hi Muhanad,

      Generally when we see this it’s a result of the From Email settings. When you get a chance, please check that your Gmail/G Suite address (used to set up the Google App in this tutorial) matches the From Email in your form settings (in the form builder under Settings > Notifications).

      Once the From Email matches the email used in the SMTP set up, SMTP will be able to work on your forms.

      I hope this helps! 🙂

  102. Please help! I’m stuck at the “Allow plugin to send emails using your Google account” stage. When click it, I get the 400 error, as if the Client ID is wrong. I made sure to not include any extra spaces or characters, yet the problem persists. How can I get past this stage? Much thanks!

    1. Hi Jasmin,

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

      1. Hi Rui,

        In order for SMTP to work, the From Email will unfortunately always have to match the email you set up SMTP (or in this case, the Google app) with.

        However, you can always change the Reply-To email address (here’s a screenshot showing the Reply-To field in WPForms). That way if the user replies to the email, it will go to this Reply-To email instead of the From Email.

        I hope this helps! 🙂

  103. Hello this is the error am getting, i dont know why

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

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 5.6.25
    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(): No
    PHP.curl_version(): Yes

    Debug:
    Error while sending via Gmail mailer: cURL error 7: Failed to connect to http://www.googleapis.com port 443: Connection timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

  104. Hi,

    After following all the directions above and sending a test email through WP, I got an email that states that the test email was blocked. Any clues on how to fix this issue?

    1. Hi Kate,

      I’m not sure if I’m understanding your description, so I’ll share a couple options. If WP Mail SMTP wasn’t able to send the test email successfully, it should show an error message. To help with this, we’ve shared what to do for all of the most common error messages in our WP Mail SMTP tutorial.

      If WP Mail SMTP says that it’s test email was successful, but the recipient’s email provider blocked it on their end, then this is an issue with the recipient’s email provider. In this case, it’s likely that there are extra filters in place. To address this, you’d need to get in touch with your email provider (or IT department, depending on your setup).

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

      Thanks!

  105. Hi, I am using the WP Mail SMTP plugin with gmail settings. It work very well expet that the From Name only works when I send an email test from the plugin. For the woocommerce email notifications the emails only show the “from email address” and not the “from name”. Could you please tell me how to fix this??
    thanks

    1. Hi Alex,

      The From Name option in WP Mail SMTP’s settings will generally only apply if it’s not also set within another plugin (whichever plugin is causing the email to be sent). So to address this, you’ll need to reach out to Woo’s support to find out where they set the From Name for emails that they send out.

      I hope this helps!

  106. Hello,

    I also had the misfortune to receive the error (Not Acceptable! An appropriate representation of the requested resource could not be found on this server.This error was generated by Mod_Security). However, after checking if all the settings were correct, it was up to my hosting provider, where after explaining the problems they performed a “standard fix” so said the support. It was that I was able to allow the access / communication of the site with api.

    This has so far been the only way to solve this problem.

    See you later !!

    1. Hi Rhuan,

      Yes, that’s correct — Mod_Security errors result from issues on the server, and these can generally be resolved by the site’s hosting provider. Thanks for sharing!

  107. I have found an error while I am doing a test email
    this is error message:
    cURL error 6: Could not resolve host: http://www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 6: Could not resolve host: http://www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    How to solve this error ?

    1. Hi Yana,

      Errors like this (from the cURL library) result from issues on the site’s server. If you contact your site’s host, they should be able to help you get this resolved.

      Hope that helps!

  108. I’m using Gmail to send emails from my wordpress site, however, my main email address that I use is an outlook email. Is there any way to make the email look like it came from my outlook email address?

    1. Hi Ben,

      SMTP will require that the From Email matches the email used to set up SMTP — and so the only way to modify this would be to set up SMTP to use your Outlook email instead. In case it helps, you should be able to use any of the other Mailer options in WP Mail SMTP for an Outlook email (you can find links to those tutorials here).

      Or if you’d prefer to keep your Gmail SMTP setup, you could consider modifying the Reply-To email address instead (in WPForms, you can find this in the form builder under Settings > Notifications). That way, while the From Email can’t be modified, any replies will go to the other email address you add to this setting.

      I hope that helps!

  109. After hitting the button “Allow plugin to send email using your Gmail account” I get this 401 error:
    response_type=code
    access_type=offline
    client_id= 1099249652751-1pq94esstn0tnjcpm5i2mjld0vdim03e.apps.googleusercontent.com
    redirect_uri=http://defishinsee.ihostfull.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
    Any idea whats going on?
    Cheers

    1. Hi Sebastian,

      I searched the WP Mail SMTP support forum, and it looks like this issue has been encountered and resolved by others. Based on the discussion between Slava (one of our developers) and users, it sounds like deactivating other SMTP plugins resolved the issue.

      If that doesn’t do the trick, the best next step will be to search for other potential code conflicts (in case it helps, here’s a guide from WPBeginner that shows how to do this).

      I hope this helps you to locate the issue and get this resolved! And if you currently have/decide to purchase a paid license for WPForms, our support can certainly assist further.

      Thanks!

  110. Hi dears, i can’t send mail in any way. I tried with my Godaddy smtp values.
    AFter some trying i got finally the ok, from email test, but i don’t receive any email.
    I tried with differents email box, nothing.

    So i tried with gmail, but when i open the Wp Mail smtp, i can’t find ” the field labeled Authorized redirect URI.”
    If i click on Google, i don’t get nothing below it

    http://it.tinypic.com/r/auv9jt/9

    Thanks
    Ale

    1. Hi guys.. problem fixed. Godaddy had server problem…
      This morning all perfectly.

      But i have another “Problem”, i write in another post

      Thanks

  111. Hi, before all, you are doing great job @Jess Quig

    My problem: I did all the configuration good, and when i send test email it seems that is fine ( ” Email send successfully”), i even receive that email, but when i go to my Contact section on my website, and fill up the form,send, and i again get message that is send successfully, but then in that case, i don’t receive that email.. I am confused, looking for solutions 2 whole days.

    Thanks!

    1. Hi Milos,

      Thanks, we try our best to help! 🙂

      For the issue you’re seeing, it sounds like the issue is with the From Email. In order for SMTP to be able to work on form emails, the From Email must match the email used to set up SMTP.

      In WPForms, you can check this by opening the form builder and going to Settings > Notifications. On this screen, you’ll see a field called “From Email”. This must be the same email you used to set up the Google app in this tutorial (your Gmail or G Suite email).

      Once this is in place, your form emails should start delivering successfully.

      I hope this helps! 🙂

  112. Hi guys, i have this “Problem”

    Actually i have a simple form to do test made with Contact form 7

    Name, email , subject and text

    Name Anna
    email: anna@yahoo.com
    Subject: information
    Text: general text

    I get this email

    Anna
    A myemail@yahoo.com

    From: Anna
    Subject: information

    Message Body:
    general text

    Is it possible get email with the email address of the sender?

    So get this

    Anna
    to: myemail@yahoo.com

    Subject: information

    Message Body:
    general text

    Best Regards

    1. Hi Ale,

      With SMTP, the From Email in your forms must always match the email you used to set up SMTP. However, you can send to any email address you’d like.

      In WPForms, for example, you can set the “Send To Email Address” to the email of the person who filled out the form (here’s our tutorial on how to do that).

      Similarly, you can set the Reply-To field to any email address you’d like. That way, if anyone replies to the email this reply can go to any email address you set (more details in the “Reply-To” section here).

      Hope this helps!

  113. Thank you a lot for your explanations. When the plugins WP Mail SMTP + Post SMTP are activated on the website. How do you generate a automatic thank you email to send to the visitors after have sending a request? Do I need another plugin to do that?
    Thank you a lot in advance!

    1. Hi Sarah,

      WP Mail SMTP is a tool to improve email delivery, however it doesn’t send any email itself (outside of the test email described above). To set up an auto-replier email within our main plugin, WPForms, you’d need to open the form builder and go to Settings > Notifications. From here, you’ll be able to set up the emails that will send out when a form is submitted.

      For more details on how to set this up, here’s our tutorial on notification emails.

      I hope this helps!

  114. Hi,

    I have the following issue. Any idea why? Thanks!

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

    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 Zac,

      Sure! If you check out the end of the article above, we’ve addressed this error there. Here’s what you need to do:

      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.

      I hope this helps!

  115. For anyone with Hostgator…

    Save yourself a lengthy and frustrating chat session and just ask them to “white list the mod sec rule”. After 2 hours and 2 representatives this was what fixed the “Not Acceptable” error you get when trying to verify with Gmail.

  116. Please help me, i follow all step at this article i’m sure coloum Client ID, Client Secret, Authorized redirect URI filled properly . i always get Error 400

    400. That’s an error.

    Error: redirect_uri_mismatch.

    how to correcting this ? i’m frustatted

    1. Hi agung,

      I’m sorry to hear you’re seeing this issue! Since you’ve already tried re-copying these details and are still seeing the same error, the next best thing to try is contacting your site’s hosting provider. It’s possible that something on the server is preventing Google and your site from communicating properly, and if so your web host should be able to help sort that out.

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

  117. Hi, thanks for this tutorial it was very helpfull ! I just have a little issue after the allow plugin to send e-mails to your google account step. I get an error saying

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

    I am not sure what is wrong, could someone help me please ?

    1. Hi Shawn,

      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 check the server logs to determine which specific rules within Mod_Security 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!

  118. I am getting the exact same message as the previous forum message – I have re-synced several times – I verified the email and on Gmail and allowed less secure apps. Any other suggestions?

    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.0.22
    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

    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 Terri,

      Since you’ve tried redoing these steps and are still seeing this issue, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      You could also consider trying the “Other SMTP” mailer option, which uses regular SMTP rather than an API. If the issue is server related, it’s possible that this other option will also not work — however in this case a different error would appear (which may help your hosting provider to further narrow down potential issues).

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

  119. The configuration works fine for me and the test message is sent. However, I get the following message in the body and it lands in the Junk folder:

    “[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing%5D

    This email was sent by Gmail mailer, and generated by the WP Mail SMTP WordPress plugin.”

    Is this going to be in all emails sent from my site?

    Thanks!

    1. Hi Mal,

      When we’ve seen this notice previously, it was because the From Email was different from the email used to set up the Gmail app. When you get a chance, please check that the email used to set up the app is the same one used as the From Email under Settings > WP Mail SMTP.

      If you use a forms plugin like WPForms, you’ll need to be sure that the From Email used in the email settings for your forms is set to this same email also.

      I hope this helps!

      1. Actually, the From email address is the same as the plug-in address. I determined that this is a message placed in the body by Microsoft’s anti-spam service.

  120. I am getting the following error when i paste the authorized redirect URL into the google API page:

    Invalid Redirect: [URI] must end with a public top-level domain (such as .com or .org)

    I am using an EC2 server. Is there any way to edit the URI in order to meet this requirement?

    1. Hi Jake,

      I apologize, but I’m not sure that I’m fully understanding the issue. When you get a chance, could you please get in touch? (You can use the right-hand form, and please mention my name). From there, we’ll be able to better assist.

      Thanks! 🙂

  121. Hello,
    I have followed all of the steps to set this up and have an error when I get to the test email part. As per an earlier suggestion, I went through all of the steps a second time, but still no joy.

    One thing that was a little odd was that when I did the last step of the set up (clicking allow plug-in to send emails) I had a warning message from google stating that it was not verified and was only able to allow it by clicking the advanced settings. It all went through fine, but the test email creates the error below.

    Here is the error message:
    Versions:
    WordPress: 4.9.4
    WordPress MS: No
    PHP: 7.0.28
    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
    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”
    }
    }
    Any advice on where I have gone wrong?

    1. Hi Fae,

      We’re 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).

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  122. Is there a way to set this up with an “alias”? I have set up the entire thing as described above, but I have an alias for my email replies. The only email address choice I was given during the steps mentioned above was the main address. The alias address was not a choice. Thoughts?

    Thanks for your help!

    1. Hi Wade,

      In order for Gmail or other SMTP setups to work, you’ll need to use your regular email address for both the Google API setup and the From Email. In case it helps, though, if you’re using WPForms as your forms plugin you can easily modify the Reply-To email (in the form builder under Settings > Notifications). Since the Reply-To email doesn’t play a role in SMTP setup on your site, this can be set to any email address you’d like — and that way, any responses to the emails you send out can use this other email address.

      Hope this helps! 🙂

  123. Hello. First, Thank you for your good plugin.
    I use the easy digital download plugin. Your plugin has been set up correctly and email comments and sales are sent to the admin email but the receipt will not be sent to the buyer(users). Should there be a change to the EDD plugin??

    1. Hi Reza,

      In order to find assistance with the EDD plugin and its settings, you’ll need to get in touch with EDD’s support team. They should be able to help you locate the setting(s) you need! 🙂

  124. hi, why when I click the “Allow Plugin to send email using your google account” it redirect me with “error 400 (OAuth2 Error)!!1” which said my authentication does not match, but I’m pretty sure its match with the API key I created

    1. Hi Jeremy,

      We’re 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).

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  125. It’s shows error like this sorry I supposed to paste this in support forum but I can’t find sign up option there. I just shift my website to aws ec2 from the traditional hosting, I used “All-in-one-Migration” plugin. Even in my Settings > General I changed the email but it shows me, the email address need to confirm but I didn’t receive any email from the last two days. And one more thing I can’t change my website address, after shifting to aws the option is also blocked. I really appreciate please help me!

    Versions:
    WordPress: 4.9.5
    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”: “usageLimits”,
    “reason”: “accessNotConfigured”,
    “message”: “Project 578645609530 is not found and cannot be used for API calls. If it is recently created, enable Gmail API by visiting https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=578645609530 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.”,
    “extendedHelp”: “https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=578645609530”
    }
    ],
    “code”: 403,
    “message”: “Project 578645609530 is not found and cannot be used for API calls. If it is recently created, enable Gmail API by visiting https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=578645609530 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.”
    }
    }

    Please help me!

    1. Hi Deepak,

      We’re sorry to hear that SMTP isn’t working for you yet. When we see issues along these lines, 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).

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  126. Take all my money! It worked Thank you so much for all these step by step instructions and for all your hard work helping us with all the web things

  127. I’ve carefully gone through this process several times and finally have it right. Test emails go through to Gmail. But, I still cannot get emails or messages sent from my WordPress site to go to my Gmail.

    Help!

    1. Hi Jim,

      I’m sorry for the trouble with that! Generally when we see this issue, it’s because the From Email is different from the email used to set up the Google app. When you get a chance, please check that the email used to set up the app is the same one used as the From Email under Settings > WP Mail SMTP.

      If you use a forms plugin like WPForms, you’ll need to be sure that the From Email used in the email settings for your forms is set to this same email also.

      I hope this helps! 🙂

  128. Hi there,

    Last week we installed the plugin and it all worked well.

    Today we couldn’t send any e-mail from the website. If I send a test mail following error code appears

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

    Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 5.6.33
    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”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }

    Could you please help us out what to do to make it work again

    Kind regards,

    Sebastiaan

    1. Hi Sebastiaan,

      From that error message, it looks like there’s an issue with the Client ID/Client Secret from the Google app. When you get a chance, could you please repeat the steps from this tutorial to create new values for each of these fields?

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  129. Hi,
    When I make a “Test email”, I receive an email with the “From name” + “From adresse” (Exemple : Sarah ), but it works only on the test mode, all the emails send by woocommerce are only with the “From adresse” and no name displayed… I would like to display the name, how to do that ?
    thanks

    1. Hi Sandrine,

      When using a specific plugin, like WooCommerce, to send emails WP Mail SMTP will allow that plugin to set the From Name and From Email. This means that in order to set these values, you’ll need to dig into the settings for that specific plugin.

      Hope this helps!

  130. Hi,
    After going through all these steps I saved the Client ID and Secret in the plugin settings. Unfortunately nothing happened after the refresh. I don’t see anymore a “Save Settings” Button nor a “Allow plugin to send emails using your Google account.”….

    If I wanna make a testemail (or a user tries to send a form) you get a 500 Error! What can I do? Without a “Save Settings” Button I also can’t change the values to “empty”…

    I never got a popup or a Submit Button for Allowing plugin…

    1. Hi Thom,

      We’re 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). Also, be sure to check that there are no other SMTP plugins installed on your site as they tend to conflict with one another.

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

    1. Hi Shailesh,

      I’m sorry for the trouble with that. From the second screenshot you shared, it looks like your site is running an outdated version of PHP. The Google mailer option requires that your site runs PHP 5.5 or higher in order to work. In order to find out if this can be updated for you, you’ll need to get in touch with your site’s hosting provider.

      Unfortunately if they aren’t able to update to a more recent version of PHP, this mailer option will not work on your site. Hopefully they’re able to help you with this, though!

      Hope this helps 🙂

  131. Good evening,
    I made the configuration according to the explanation and when I ran the test the following error appeared:

    Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 5.6.35
    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

    Debug:
    cURL error 7: Failed to connect to http://www.googleapis.com port 443: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 7: Failed to connect to http://www.googleapis.com port 443: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 7: Failed to connect to http://www.googleapis.com port 443: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 7: Failed to connect to http://www.googleapis.com port 443: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    What could it be? I can not find an explanation.

    Thank you

    1. Hi Fausto,

      We’re 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).

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  132. Hi,

    I’ve followed all of the steps and I’m getting a “App isn’t verified” as well as these errors when I ran the test:

    Versions:
    WordPress: 4.8.6
    WordPress MS: No
    PHP: 5.5.37
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: gmail
    Constants: Yes
    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 Samantha,

      We’re 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).

      After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

      If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  133. Jess,

    We have this setup on a client’s site, but I want to change the email that it uses. I setup a new Google API key, but when I switch it, there is no way to authorize it. Is there a way to get rid of the initial authorization and authorize it with a new email account? The “Allow plugin to send emails…” button doesn’t display.

    Thanks,

    Mike

    1. I was able to save it with blank fields, then re-enter the Client ID and Client Secret which seemed to work.

      Thanks,

      Mike

    2. Hi Mike,

      I’ve tested this out myself, and here are the steps I’d recommend:

      1) Delete the Client ID and Client Secret (and any other details you’ll be changing)
      2) Click Save Settings (it’s possible that the button will already appear now)
      3) Enter all the new values for this other email, including Client ID and Client Secret from the new app
      4) Again, click Save Settings

      This should allow the Authorize option to reappear so that you can go through that permission process.

      I hope this helps! 🙂

  134. Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 5.5.38
    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”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }
    Error while sending via Gmail mailer: {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }

      1. Hi Liam,

        We’re 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).

        After this, if the problem persists, generally the next best thing to try is contacting your site’s hosting provider. Most SMTP issues are a result of server configuration issues, which your host should be able to help resolve.

        If you’d like us help debug and investigate the issue further, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

        Thanks!

  135. Hi, nice work with this plugin which seems to work fine.
    I have a small problem though: the main email address of my WP site is not a Gmail one (i only use a gmail account for relaying purpose), therefore when i sent a contact form from my website, my main WP email address indeed receives the email but with the gmail account as the main sender . The original sender account (filled in the contact form) only appears when i ask to “reply to all” (if not, i only reply to this relaying Gmail account). I don’t want this Gmail account to appears in the exchange between sender and receiver.
    Did i missed something?
    Thank you

    1. Hi coconutyoyo,

      When using SMTP, you’ll always need the email you set up the SMTP with to be the From Email. For example, if you set up SMTP with a Gmail email, you’ll need to use this same Gmail email as the From Email for all emails sent out from your site (otherwise, these emails will not be able to be sent using SMTP).

      However, you can set up SMTP with any email you’d like — this doesn’t have to be a Gmail email. For other mailer options in WP Mail SMTP, you can check out this tutorial.

      I hope this helps and answers your question! If you have any other questions, we offer email support for WP Mail SMTP to users with an active WPForms license. Additionally, as a valued WP Mail SMTP user, we offer 20% off your initial purchase 🙂

      Thanks!

  136. Hey there,
    I’ve read the comments above, and I also was getting the 400 error client_id missing. I redid everything, cleared caches, double checked for whitespace and got someone else to do it too. But all to no avail.

    However, after checking the URL that the submit button was posting to, the GET parameter to google contained a completely empty “client_id=&” entry. Therefore, for some reason, it was not picking up anything from the entry box of the form for client id.

    We tested it with different strings and nothing was filling in the &client_id= GET Request parameter in the URL.

    I manually copy/pasted my client_id into the URL string and it authorised correctly. (Which I suggest to anyone else who is struggling with this error)

    However, there is definitely something wrong somewhere. Thought you should know.

    1. Hi Andy,

      Thanks for sharing how you got around this! I asked our developers, and it turns out this in an issue with the Google Library (another plugin is loading the library earlier in the page load, which then prevents WP Mail SMTP from being able to use it properly). I don’t have an ETA on the fix release just yet, but our dev team is working on improvements that will help to avoid this issue.

      In the meantime, your solution is a great idea. Thanks for passing that along! 🙂

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.