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

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

Also, we recommend that you check the box labeled Force From Email. Since the From Emails from anything on your site that sends email must match this email address in order for SMTP to work, this will save you the trouble of editing the email settings throughout your site (in all form emails, etc).

Enable the Force From Email option in WP Mail SMTP

You may add any From Name you’d like, and you can also choose to Force From Name to apply this setting site-wide. Unlike From Email, having a specific From Name is not critical to the plugin’s functionality. However, it will help email recipients to easily see where these emails are coming from.

Set a From Name in WP Mail SMTP settings

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

Frequently Asked Questions

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.

What If I Want to Switch to A Different Email Later?

If you’d like to change to a different Gmail/G Suite email address, you’ll need to repeat all tutorial steps above. This includes generating a new Client ID and Client Secret under this other email account.

When you get to the Authorization step (under Step 3), save your settings and then click the Remove Connection button. This will remove the authorization for your original email account and allow you to repeat the authorization steps with the new email.

Remove connection in WP Mail SMTP

That’s it! You’ve successfully configured WP Mail SMTP’s Google mailer 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. Thanks for reading this article – I hope you found it helpful.

    I wanted to let you know about our new WordPress survey plugin that allows you to build interactive polls and surveys within minutes. You also get best-in-class reporting, so you can make data-driven decisions.

    You can get it 100% free when you purchase WPForms Pro plan.

    Get Started with WPForms Today and see why over 1 million websites choose WPForms as their preferred online form builder.

    Syed Balkhi
    CEO of WPForms

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

        Can you please tell us the rule that Hostgator found. I spent hours speaking with different representatives and neither can figure this one out. tia

      3. I had the Mod_Security error with this plugin. It was frustrating dealing with Hostgator support. They did manage to fix it, and here’s how

        “We have to override the mod_sec rule by delisting your local IP within the server in order for the SMTP plugin set-up to push through without triggering mod_sec.”

        So if you contact them, and they seem confused, this may help guide them in the right direction.

        I hope this helps someone

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      2. Hi, I am encountering the same problem as DAN: Error: “invalid_request Missing required parameter: client_id” Redid and checked everything carefully, but without success. Is there already an explanation for that error and how I can get around? Thank you!

      3. Hi Franz,

        I’m sorry to hear this isn’t working for you yet. If you’ve already tried repeating all steps from this tutorial, 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 to 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 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.

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

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

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

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

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

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

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

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

  30. =========================
    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! 🙂

  31. 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”
    }
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  51. 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”
    }
    }

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

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

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

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

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

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

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

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

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

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

  62. 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”
    }
    }

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

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

      1. Hello,

        I’m having the same error when I reach this step: Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setClassMapAuthoritative() in /xxx/xxxxx/public_html/wp-content/plugins/wp-mail-smtp/vendor/composer/autoload_real.php on line 38
        Can you help me?
        Thanks in advance

      2. Hi Luciano,

        I’m sorry for the trouble with that! We’ve seen this issue before, and our dev team is investigating it. However, I apologize as I don’t currently have an ETA on a resolution.

        That being said, this issue appears to only happen with the Google mailer option. So in the meantime, I would recommend trying one of the other mailer options within WP Mail SMTP (any option should work with Gmail/G Suite). You can find links to tutorials on each mailer option here.

        Thanks! 🙂

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

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

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

  68. 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) 🙂

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  138. I have completed the above procedure up to Step 3: Authorize plugin to send emails with Gmail

    And then reached the part:
    When you’re ready, click the Allow button to proceed.

    But after clicking Allow, it just redirected back to my site and showed this error:

    Oops! That page can’t be found.
    This is somewhat embarrassing, isn’t it?

    It looks like nothing was found at this location, e-mail us at support@mysite.com to get you the right thing.

    Is there a way to configure this manually from WP configuration files? I mean, I can see the token getting appended at the end of the Redirect URI, I am sure that is just being saved somewhere by the plugin.

    1. Hi EA,

      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.

      You might also consider trying one of the other mailer options (you can find links to the tutorials for each mailer option here).

      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. The link you sent to purchase is dead. Please send me a link on how to buy an email support for WP Mail SMTP plugin? I went to your site but I only see WP Forms purchase

      2. Hi EA,

        Sorry about that! There was an issue with the quotes in the HTML link, but that’s fixed now. Also, yes that’s correct — WP Mail SMTP is a free plugin available to anyone, however we provide support for it to paid users of WPForms (it’s parent company). Based on the error you shared, though, this issue sounds server-related. So in this case, the best next step is to contact your site’s hosting provider to ask them to investigate further.

        Hope that helps!

  139. Hi all,
    I managed to make smtp work using google account without creating any app from google. I’m not sure whether its an proper way to do it. here is what i did.

    1. for mailer i choosed other SMTP option
    2.SMTP host: smtp.gmail.com
    3.SMTP port: 587
    4.encryption: tls
    5.authentication: on
    6.smtp username : senders’s gmail address
    7.smtp password: sender’s gmail password

    is this method secure and reliable? please let me know

    1. Hi Javeed,

      You can certainly choose the Other SMTP mailer and use this approach if you’d prefer. We describe this option in our tutorial here. However, it’s important to note that the Other SMTP mailer option will inherently be less secure than using an API, such as in the approach described in the tutorial above.

      I hope this helps! 🙂

    2. I followed your procedure step by step but I got an error when I try to send a test email. Any thoughts?

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

      1. Hi EA,

        Errors like this are generally server-related. So in this case, the best next step is to contact your site’s hosting provider to ask them to investigate further.

        Hope that helps!

  140. Hi Jess,
    I have a problem once to get google’s permission: (just after i click
    “Allow plugin to send emails using your Google account”)

    400. That’s an error.

    Error: invalid_scope

    Some requested scopes were invalid. {invalid=[https://www.useso.com/auth/gmail.send]}

    Learn more

    Request Details
    response_type=code
    access_type=offline
    client_id=995464017247-v9ju0ji7biu47cri3gtdi858nmmff44k.apps.googleusercontent.com
    redirect_uri=http://www.boxpackingsolution.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    state=
    scope=https://www.useso.com/auth/gmail.send
    approval_prompt=force
    include_granted_scopes=true

    1. Hi Wendy,

      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!

  141. When I tried to send test email, i got this:

    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.33-1~dotdeb+zts+7.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

    What could be wrong? I synced wp with my gmail account.

    1. Hi Ruta,

      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!

    1. Hi Paras,

      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!

  142. Hi, please help me with an error. I’ll be really thankful for this. I followed all steps but I’m getting the following message as 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)
    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)

    1. Hi Ashish,

      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. For cURL errors like you’re seeing here, be sure to share the specific error details you’re seeing with them — this is nearly always a server-related issue.

      Thanks!

  143. WP SMTP Email Plugin

    TL;DR – When I attempt to authenticate the plugin to GSuite
    “There was an error while processing the authentication request. Please try again.”
    Test send email
    Error code: “401 Login Required”

    I’m stuck and have no idea what I’m doing wrong

    Hostgator Hosting (Mod_security whitelisted via HG customer support)
    G Suite Legacy Account (Free)with API’s enabled
    Google API > Created an API project with GSuite Account
    Google API > Setup New Credentials using GMail API , Web Server, User Access
    Google API > Added Authorized JavaScript origins > http://domainname.com
    Google API > Added Authorized redirect URIs > http://domainname.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    Google API > Created Credentials
    Google API > OAuth consent Screen > Correct Email address; Product Name “WPForms”; Homepage URL http://domainname.com; SAVED

    WP SMTP Email Settings>Set email to GSuite email admin@domain.com.
    WP SMTP Email Settings> Copy/pasted Client ID/Client Secret to WP SMTP Mail plugin (No spaces)
    WP SMTP Email Settings> Save Settings
    WP SMTP Email Settings> Authenticate > “There was an error while processing the authentication request. Please try again.”
    WP SMTP Email Settings> Test email > Error code: “401 Login Required”

    Any help/suggestions would be greatly aprreciated

    1. Deleted and redid absolutely everything to do with WP SMTP Plugin and my GMail API, now it works.
      I knew the second I posted for help I’d get it working.

      thanks

  144. HI

    I am getting an error at Step – 3

    The error says

    Error: redirect_uri_mismatch

    The redirect URI in the request, http://www.usbplastfinechemicals.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/747124841447-9ukj202qujf1vrks6pffjclmvaq0np3d.apps.googleusercontent.com?project=747124841447

    I have added correct – client id & client secret.
    Please help in solving this error.

    1. Hi Rucha,

      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!

  145. Getting the following:

    400. That’s an error.

    Error: invalid_request

    Missing required parameter: client_id

    Learn more

    Request Details
    That’s all we know.

    I tried the client ID 2 times and I’m 100% positive that it has been inputted correctly. Any suggestions?

    1. Hi Chris,

      We’re sorry to hear that SMTP isn’t working for you yet. If you’ve already tried redoing the steps and the problem persists, 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 to 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!

  146. Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 5.6.36
    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”
    }
    }
    Error while sending via Gmail mailer: {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “failedPrecondition”,
    “message”: “Mail service not enabled”
    }
    ],
    “code”: 400,
    “message”: “Mail service not enabled”
    }
    }

    1. Hi Eman,

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

  147. Hi!

    I met a problem when sending a testing email:
    ————————
    Debug:
    cURL error 77: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 77: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    Error while sending via Gmail mailer: cURL error 77: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 77: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    —————————————-

    I asked my hosting provider for solution, and here is their reply:
    —————————-
    Check https://stackoverflow.com/questions/42477382/phppath-of-curlopt-sslcert Please consult the provider of your code, to add the following code

    curl_setopt($ch, CURLOPT_CAINFO, ‘/ews/htdocs/mycertdir/rootca.pem’);

    before

    curl_exec($ch);

    The main point of this is to specify the CA cert location.
    ———————————————-

    Could you please tell me how to add this code?

    Thanks a lot!

    1. Hi Song,

      I apologize that your hosting provider wasn’t more helpful with this, and I would recommend reaching back out to them to ask them to install this for you. This is fairly basic server functionality (meaning that your site’s server is currently misconfigured) and so as a hosting provider they should be prepared to fix this issue for you.

      I’m sorry that we’re not able to assist further from our end, and I hope your site’s host is willing to resolve this for you!

  148. hi,
    thanks for that, its very helpful
    but i have a problem
    mails successfully send, but email sender and name doesn’t work and that gmail(connected with api) shows in sender name and email 🙁

    1. Hi Mosenth,

      Sorry about any confusion, and what you’re describing is actually how this is meant to work. When using this method (any option like this) to fix email delivery issues, the From Email must always match the email used to set up your app in Google. So the email address must match in 3 places:

      1) The email used to set up the Google app
      2) The From Email used under Settings » WP Mail SMTP
      3) The From Email used in your form emails

      However, you can set a different From Name if you’d like. You can set this under Settings » WP Mail SMTP, but if you’re using an email plugin you’ll need to set it there as well. In WPForms, this is done within the form builder (so separately for each form) under Settings » Notifications.

      Hope this helps!

      1. im using gmail method
        in this plugin i set the mail sender and name sender but doesnt work
        in google app nothing for this to i can change that
        now, emails that are sent, dont have any sender name and shows gmail sender 😐

  149. Hi,

    Since today the plugin isn’t sending mail anymore. Looks like googleapi.com isn’t reachable anymore:

    Tried to send a test mail:

    Versions:
    WordPress: 4.9.5
    WordPress MS: No
    PHP: 7.0.30
    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 6: Could not resolve host: http://www.googleapis.com; Name or service not known (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com; Name or service not known (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com; Name or service not known (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; Name or service not known (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 6: Could not resolve host: http://www.googleapis.com; Name or service not known (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    Tried other plugins, and looks like more smtp plugins have the same problem.

    Hope to hear from you 🙂

    1. Hi Gijs,

      I apologize for the trouble. In most cases cURL issues are a result of an issue on your web host’s server.

      Unfortunately, we’re not able to resolve server issues. However, the good news is your hosting provider should be able to assist further.

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

      I hope this helps!

  150. So i have allowed the plug in to verify with google, now I get this message.
    What am I doig wrong? Have checked with Blue host they say its not their end.
    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 Rose,

      I apologize for the trouble. In most cases Mod_Security issues are a result of your web host’s firewall or server configuration.

      Unfortunately, we’re not able to resolve server issues. However, the good news is your hosting provider should be able to assist further. Specifically, we recommend contacting your web host and asking them to disable “mod_security” or in some cases they can check the server logs to determine which specific mod_security setting to turn off.

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

      I hope this helps!

  151. Hi,

    I have a public contact address created within G Suite as a contact group that forwards email to personal.addresses within my origination – thus we never have to give out personal addresses, just the contact address.

    I would like to use this contact address for the purpose of this SMTP setup but it’s not an email address that I can sign into G Suite with it’s just a group email address.

    Can I sign into Google Developer console with my primary G Suite email and set up the the OAuth app using the the public contact address?

    1. Hi Social Foxes,

      In order to ensure this setup works properly, you’ll need to use the same email address to set up the Google App and SMTP (so, as the From Email on your site). So you’ll need to use an email address that you can log into when you go to set up the app.

      Hope this helps! 🙂

  152. Hi

    I am getting this error– “This app isn’t verified
    This app hasn’t been verified by Google yet. Only proceed if you know and trust the developer.”

    when I try to login with my gmail account after selecting the option “Allow Plugin To Send Email Using Your Google Account”

    Please help.

    1. Hi Rucha,

      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). If you still see this message, go ahead and click the proceed option to continue through the process.

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

  153. Hello,

    i’m using wordpress on wampserver and i want to send my wordpress emails by gmail smtp. For the process, i want to create a web application (in google API) but i’m stuck in step “add credentials to your project”: in the box “Authorized javascript origins”, should i add my local wamp website adress or the adress of my reserved domain name i got from my host? Sorry for my bad english)

    1. Hi Patrick,

      If you need this to work on your local site, you’ll need to go through the full process with the details specifically for you local site. Then if you later launch this site to a live domain, you’ll need to repeat the process using the new details for that domain (so you’d create a new Google app for this live domain).

      Hope this helps!

  154. Debug:
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\xampp\php\extras\ssl\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:\xampp\php\extras\ssl\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    cURL error 77: error setting certificate verify locations:
    CAfile: C:\xampp\php\extras\ssl\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
    please help me

    1. Hi Rahul,

      Unfortunately cURL errors like this generally result from server configuration issues, however your site’s hosting provider should be able to help to get this up and running for you! The best next step is to contact them and ask them to investigate further (based on this error, it looks like they’ll need to install a certificate for you).

      Hope this helps! And if you have any other questions about WP Mail SMTP, please know we provide limited support through the WP.org support forums. Thanks 🙂

  155. Eu troquei o e-mail do google e não aparece mais a opção de Autorização de Permitir que o plugin envie e-mails usando sua Conta do Google. O que eu faço?

    1. Hi Evandro,

      If you don’t see the permission button (but haven’t yet provided permission), I’d recommend deleting the Client ID and Client Secret, saving the settings, and then doing a hard refresh on the page. Then, you can re-enter these details and save again — in most cases, this will cause the permission button to reappear.

      I hope this helps! If you give this a try and are still stuck, please know we provide limited support through the WP.org support forums.

      If you could please create a support thread with any available details, we can assist from there. Thanks 🙂

  156. AWESOME step-by-step! Really easy to understand. I was sending emails through my website in less than 20 minutes!

  157. I’m using gmail.com to send my emails, and get the following errors:

    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)

    What needs to change/be added?

    1. Hi Jeff,

      Sorry to hear that SMTP isn’t working for you yet. With an error like this, generally the next best thing to try is contacting your site’s hosting provider. This error is a result of server configuration issue in which the cacert.pem can’t be found (could be missing or in the wrong location), which your host should be able to help resolve.

      Hopefully your site’s hosting provider is able to provide a quick resolution for you. Thanks!

  158. This was the error message that popped up after I tried to authorize the Plugin at the end of Step 3

    Any suggestions?

    “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 Greg,

      I apologize for the trouble. In most cases Mod_Security issues are a result of your web host’s firewall or server configuration.

      Unfortunately, we’re not able to resolve server issues. However, the good news is your hosting provider should be able to assist further. Specifically, we recommend contacting your web host and asking them to disable “mod_security” or in some cases they can check the server logs to determine which specific mod_security setting to turn off.

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

      I hope this helps!

  159. Hi.
    thanks for the tutorial however i got to the authorise plugin step ang got this:
    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.

    what do i do?

    1. Hi Manny,

      In some cases when we see this, you can simply click the “Proceed” option and continue on with no additional issues. So that’s the best next thing to try. If you do this and see a new error, this will most likely be a result of a mod_security issue on the server (basically, the site’s server prevents you from granting the permissions needed). In this case, best next step is to contact your site’s hosting provider to ask if they could modify this (however, if no additional error appears, you’re good to continue as normal).

      Hope this helps!

  160. After 2 hours of tech support from hostgator this was the result for the mod_security error “Just a recap of what we did, we successfully white list your local IP and delist the mod security rule that is being hit by the process. “

    1. Thanks for sharing that, Aydin! I’m sorry to hear it took so long for your host to get this sorted, but I’m glad they were able to fix this for you. We’re working on expanding our FAQs/Common Issues, and I’ve made a note to include this to hopefully help others as well 🙂

  161. Great plugin and great procedure!

    I have input my Client ID, Client Secret and copied the Auth. Redirect URI over. I then noticed I had a space in my Client Secret so have reset this, copied it without the space and pasted it back into the relevant field…

    So, the glitch appears to be that my save button has disappeared! I am unable to remove any of these details and start again, I’ve attempted to de and reactivate the plugin with no success.

    I’m also unable to see the “Allow plugin to send emails using your Google account.” button that is meant to appear at the bottom of this screen.

    Is there a way to reset this so that I can start again?

    1. Hi Karen,

      Generally the best way to get this addressed is to first remove the Client ID and Client Secret and save the page settings. Then add these details back in and save the settings again. After this, the orange button should reappear.

      I hope this helps!

      If you’d like us to 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!

  162. Hi I have done all he says to do. The test email sends for me .
    but to register it doesnt send the activation email. Does anyone have any ideas what it is ?

    1. Hi Nathan,

      Since the WP Mail SMTP test email works, the good news is that the SMTP settings are good to go.

      If you’re using a plugin to register new users (such as WPForms User Registration addon), you’ll just need to make sure that the From Email in your form settings (for WPForms, within the form builder under Settings > Notifications) matches the email you used to set up SMTP.

      So the email will generally need to match in 3 places: 1) The email used to set up the Google app, 2) The email used as the From Email in your WP Mail SMTP settings (under Settings > WP Mail SMTP), and 3) If applicable, the From Email in any additional plugin you may be using that sends email (such as a forms plugin).

      Hope this helps!

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

    Versions:
    WordPress: 4.9.6
    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
    Apache.mod_security: No

    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)
    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 Prasanth,

      I apologize for the trouble. In most cases this cURL/SSL certificate error is a result with your web host’s server configuration.

      Unfortunately, we’re not able to resolve server issues. However, the good news is your hosting provider should be able to assist further. When you have a chance, please reach out to them and let them know about this error.

      I hope that helps you to get a speedy resolution!

  164. Hi,
    I am getting 401 login required error. I have gone through every step meticulously (especially step 3 as advised). Nothing is helping. Everything went as described in your instructions….it just still errors.

    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 help,
    Adam

    1. It appears to be the redirect that is failing. I constantly have the orange authorization button at the bottom of the settings page. The redirect after authorizing simply goes to a ‘this is embarassing’ page (cannot find the page). The URL for the page is fine without the ‘auth code’ on the end of it but it fails when it is present.
      Please help

      1. Hi Adam,

        Generally when we’ve seen issues like this, it’s been a result of an issue with the server. Unfortunately we’re not able to resolve server-related issues, but as next steps you could consider a couple of options:

        1) You could get in touch with your site’s hosting provider to ask them to check server logs (in case more details on this issue have been recorded there) or look into other possible causes.
        2) You could try a different mailer option within WP Mail SMTP, which may allow you to get around this issue.

        I hope one of these options helps you to get this up and running!

  165. Hi,

    I am trying to setup my new branded gmail pro (I shifted from a normal gmail to a business gmail account – G suite) with the plugin. I have finished all the required steps and have filled the “from email” (in the WP mail SMTP) with my new “info@brandedmail.com”.
    When I try to send a test email, it works but the sender is not the new branded email but the normal gmail that I was using before this setup.

    Is this related with any other plugin in which the normal gmail is configured? e.g. I have SendGrid plugin and normal gmail is configured on that, Woocommerce and again normal gmail, WordPress>settings etc..

    Thanks

    1. Hi Tanasi,

      If you have another SMTP plugin (like SendGrid) on your site, these plugins will conflict and likely break one another’s functionality. In this case, the best next step would be to choose just one SMTP plugin to move forward with, then deactivate any others.

      If you’d like to move forward with your G Suite email here, you’d also need to double check the setup described in this tutorial. Specifically, you’d need to be sure you set up the Google app with your new, branded email address (the email you’re going to use as the From Email). When done, the email will need to match in 3 places:

      1) The email used to set up the app in Google
      2) The From Email in the WP Mail SMTP settings (under Settings > WP Mail SMTP)
      3) The From Email used in any plugins that send out emails (WooCommerce, any forms plugin, etc)

      Once this is all done, your From Email should display correctly.

      I hope this helps! 🙂

      1. Thank you for the great answer!
        Yes, this did the trick. I disabled SendGrid and it works..

  166. cant sent test mail. showing error below:-
    There was a problem while sending a test email. Related debugging output is shown below:
    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 7.0.29
    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
    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 Vishnu,

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

  167. I’ve used this plugin many times in the past for other sites. However, when I have tried to set it up recently, I get this message when I try to authorize the plugin:

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

    Then if I try to verify the app, I get taken on a whole journey of verification stuff that I thought was not part of an OAuth app. If I try to send a test email, then I get the errors that Vishnu experienced above. I am following your instructions, as I have successfully for many other sites. Has Google changed their permissions?

    1. Hi Andrea,

      Some users encounter issues like this because their web host is blocking something the plugin/app needs to run. However, I’m not familiar with any extra verification steps (generally you can just click “proceed” on the page you mentioned and continue as normal from there).

      If you go through the steps once more and still see any issues, 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 (and possibly something is different about this site than the others).

      If you’d like us to 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!

  168. Hi there. I get so close, then when I come to click on “Allow plugin to send emails using your Google account” it goes through the process, asks me to log in, asks me to approve the “send email on behalf” access, then when I approve, it returns to a “not found” 404 page. I have used the URL copied from “Authorized redirect URI” with no changes, spaces, etc. Any thoughts on what needs to change?

    1. Hi Dan,

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

  169. Hi

    I have folowed the steps supplied and am getting the following error when sending a test email.

    Please can you suggest a solution?

    Many thanks
    s

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

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 5.6.36
    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
    Apache.mod_security: No

    Debug:
    Version not supported
    Version not supported
    Error while sending via Gmail mailer: Version not supported
    Version not supported
    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 Steve,

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

  170. Hi, Great guide !

    I have this error, can you help me ?

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

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache Server at novellaaurora.it Port 80

    Thanks

    1. Hi Vincenzo,

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

  171. hello, i use your plugin on a half-dozen of my sites but suddenly when installing the plugin on new sites i’m getting an Error 400 , “Error: redirect_uri_mismatch” when i try to authorize the plugin with the gmail api. the plugin works fine on my existing sites. this is an installation problem limited to new sites.

    i have followed all relevant suggestions from you in this comment thread for other users with the same error. i have verified that the clientid, secret and redirect are correct. additionally, i am the hosting provider — again, your plugin is currently working on several sites running on the same server.

    any suggestions?

    1. Hi Lawrence,

      It sounds like you’ve tried all of the things I’d recommend. While I’m not sure why this wouldn’t be working, the best next step at this point is generally just to use a different mailer option. The Gmail API can be pretty finicky (generally more so than the other mailer options), and so this may just be the best route.

      If you’re willing to give this a try, you can find links to our other mailer tutorials here.

      I hope one of these other options helps you get this up and running!

  172. Hi, I have been able to set this up using Gmail. The problem is that the “from” and “return-path” on all email I send show up as my gmail address. After reading a lot of questions and answers above, I started again from scratch. I went to the WP Mail SMTP set up page, and instead of entering my gmail account address, I entered the address I wanted in my from/reply-to headers. I followed the procedure to get new credential from the Gmail API. On my WPForms Builder Notifications settings page I also entered the desired address in the from and reply-to areas.

    Once again, however, my google account address showed up in the from/reply-to headers. I am beginning to suspect that when using SMPT through the Google API, it will ALWAYS be the google address that shows up, which is unacceptable.

    Please, if it is possible, tell me what to do in order to have the desired NON-google address show up in the form /reply-to field.

    Thanks in advance.

    1. Hi John,

      I apologize for any confusion over this. The email address that you use to set up SMTP must be the same email you’d like to use as the From Email. If your From Email isn’t a Gmail/G Suite email address, you’ll need to use a different mailer option within WP Mail SMTP.

      For tutorial links on these other mailer options (which won’t require a Gmail address as the From Email), please check out our tutorial on recommended SMTP options.

      Hope this helps!

  173. Hi,

    I followed instructions and everything seems to work fine, even the test email. However, once I post a blog no notification emails are being sent. Do you have any idea why this might be?

    1. Hi John,

      Based on your description, it sounds like WP Mail SMTP is working correctly. So the answer to your question will depend on what tool you’re using to send out emails when a new blog post is published. This functionality doesn’t come built into WordPress, so most people will integrate their site to an email marketing service such as MailChimp.

      If you already have an integration like this set up, that email marketing service will send emails through their own servers (so your site’s SMTP setup won’t apply to these emails).

      Or if you don’t have email marketing integration setup yet, you could check out this tutorial from WPBeginner for tips on how to do that (their post covers several of the most popular options). You can even use WPForms, our main plugin, to build out your subscriber list through an email marketing provider (here’s a tutorial using MailChimp as an example).

      I hope this helps! And if you’d like more details on how to use WPForms to help build up your subscriber lists, please get in touch and we’d be happy to assist further. Thanks! 🙂

  174. Attempted install around 10 times. Can get through to success message on Google page, saying it’s allowed, and the plugin gives me a success message. When I hit the test mail, I get the following: (This has been repeated after uninstalling the plugin, deleting my Google API, and going through the steps multiple times)

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

      We’re sorry to hear that SMTP isn’t working for you yet. It sounds like you’ve already gone through the setup a number of times, so 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 they aren’t able to determine a source of this issue, or if you’d simply like an extra option, you could also try using a different mailer option. The Gmail API (and so this Google mailer option) tends to be the most picky, so you may have more success with a different approach. Here’s our main SMTP options list, and options #1, 2, and 4 cover the other mailer options within WP Mail SMTP.

      If you’d like us to 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!

  175. I wish I didn’t have to repost this. But I don’t understand the answers that was given to a similar issue(if any clear answer was given).

    I also ALL the steps successfully but when I come to Email Test. I get the following error Below. What exactly is the problem because I seem to have tried eveything.

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

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 5.6.36
    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

    1. Hi Nonso,

      Generally there are more details underneath the output you shared — and those help us to determine what the issue might be. Sometimes when the output is cut short like this, though, it’s because there’s another SMTP plugin active on the site. SMTP plugins tend to break each other’s functionality, so it’s important to only have one active on your site.

      If you don’t see any other SMTP plugins active, though, 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 to 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!

  176. I got his but no error. Can you help?

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 7.0.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 John,

      Generally there are more details underneath the output you shared — and those help us to determine what the issue might be. Sometimes when the output is cut short like this, though, it’s because there’s another SMTP plugin active on the site. SMTP plugins tend to break each other’s functionality, so it’s important to only have one active on your site.

      If you don’t see any other SMTP plugins active, though, 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 to 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!

  177. Hi, got this error: There was a problem sending the test mail. The related debug messages are shown below:

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 7.0.30-0ubuntu0.16.04.1
    WP Mail SMTP: 1.2.5

    Params:
    Mailer: mail
    Constants: No

    Server:
    PHP.mail(): Yes
    Apache.mod_security: No

    Thanks!

    1. Hi Albert,

      Based on this debug log, it looks like you’re still using the default mailer option (PHP.mail(): Yes). The next step is to choose a different mailer option and set that up. If you’d like to use a Gmail or G Suite email address, for example, you can follow the steps in the tutorial above these comments.

      For tutorials on the other mailer options, please check out our SMTP article — options #1-4 in that article are all mailer options within WP Mail SMTP.

      Hope this helps! 🙂

  178. Hello,

    i will be pleased if you help me. I did the things you mentioned above. I can send test mail without any error. But when i use the form on the website, the form generated mail does not come to the mail adress. ı tried several times. Where can be the problem?
    From mail is excatly which i registered at gsuite mail adress. Thank you.

    1. Hi Erman,

      If the test email is working, then WP Mail SMTP is all set 🙂 Generally when this is working but the form email still isn’t, it’s because the From Email doesn’t match the email used to set up SMTP. Specifically, the emails will need to match in three places:

      1) The email used to set up the Google app
      2) The From Email used under Settings » WP Mail SMTP
      3) The From Email used in your form emails (in the form builder under Settings » Notifications)

      Once the emails match in all 3 places, your emails should start delivering successfully.

      Hope this helps! 🙂

  179. Hi,
    We had this working, but not I can’t send mail.

    I double checked, copied over again from the app I created on Google API’s and I’m getting this error, which does not appear on anyone else’s submission:

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

    1. Hi Eddie,

      We’re sorry to hear that SMTP isn’t working for you yet. It sounds like you’ve already tried re-doing the steps in our tutorial, so 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.

      And if for any reason they’re not able to locate the cause of this issue, you might consider trying a different mailer option (#1-4 of our SMTP article will cover all mailer options within WP Mail SMTP).

      If you’d like us to 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!

  180. Hi,

    When i hit Allow, it shows me an alert
    ——————————————————–

    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

    Advanced
    ———————————–
    And when i click on Advanced and click on my site name it redirects but shows this message,

    ——
    You do not have permission to view this directory or page.
    —-

    1. Hi Harpreet,

      When we’ve seem this happen, it’s generally been a result of something on the site’s server preventing the Google API from working properly. The next best thing to try is contacting your site’s hosting provider to ask them to check into this for you.

      If you’d like us to 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!

  181. I don’t see any options to configure the encryption type when using Gmail and OAuth, but it is working for me.

    Is this plugin sending the email encrypted using TLS or SSL to Gmails servers? And does this mean all the email is fully encrypted while in transit from my wordpress site to gmails server?

    1. Hi Farr,

      The Google mailer in WP Mail SMTP uses the Google API and sends data over SSL. This also means that, as you mentioned, your email data is encrypted during communication with the Gmail server.

      Hope this helps! 🙂

  182. Setting error as follows, please help

    Versions:
    WordPress: 4.9.6
    WordPress MS: No
    PHP: 5.6.36
    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: D:\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: D:\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: D:\Program Files (x86)\Plesk\Additional\PHPSettings\cacert.pem
    CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    1. Hi Mana,

      We just recently released an update for WP Mail SMTP that should provide you with less technical troubleshooting output (for example, it’ll share actual steps you should take). The update also fixed some issues, so while I don’t expect it will fix the specific issue shown in this output, it’s worth a try!

      And just in case you’re not able to run the update for some reason, the fix for this error output generally requires contacting your site’s hosting provider. Most SMTP issues (like this one) are a result of server configuration issues, which your host should be able to help resolve.

      Thanks!

  183. Emails are sending perfectly but I’m getting a notification to disable SAR SMTP which your docs don’t mention.

    Here’s the error:

    Heads up! WP Mail SMTP has detected SAR Friendly SMTP is activated. Please deactivate SAR Friendly SMTP to prevent conflicts.

    1. Hi Adam,

      The reason you’re seeing this notice is because SMTP plugins will break one another’s functionality. This happens because they will try to do the exact same thing on your site anytime an email is sent (and the result is generally that neither will work). So you should only have one SMTP plugin active on your site at any time.

      Hope that helps!

  184. I got the “This app hasn’t been verified by Google yet.” response similar to others above. However, I chose the “Advanced” link and proceeded anyway…. Everything seems to be working as expected.

    Will this be a problem that I chose that route?

    1. Hi Erin,

      This is a common solution, and not an issue at all. For some, clicking through this shows additional blocks in the server — but for most, it’ll work just like you described. As long as the test email sends, you’re all set!

      Thanks! 🙂

  185. Oh my god – thank you so much for posting this tutorial. If every tutorial online was this well thought out and detailed, we’d never have any technical problems.

    Thanks!

  186. Hello, I have a little problem.

    I followed all the steps described above, but I noticed that the app. You are requesting a second action in addition to “sending email on your behalf”. Permission is “Read, send, delete, and manage your email.”

    How do I only allow to “Send Email on My Name”.

    1. Hi Rhuan,

      I apologize for any trouble with this! The reason that WP Mail SMTP must request additional permissions is that our developers found that in many cases, the Google API unfortunately wouldn’t work without these extra permissions enabled.

      If you’d prefer not to grant these permissions, you could consider using one of the other mailer options within WP Mail SMTP — all will work with Gmail/G Suite email addresses. If you decide to try another option, I’d specifically recommend considering Mailgun or SendGrid, as these are secure options.

      Thanks!

    1. Hi Cedric,

      We don’t place any sending limits on our end, however if you intend to have very high email volumes I’d recommend considering a service such as Mailgun or SendGrid. These are designed to handle significant demand, and will allow you to avoid concerns over possible restrictions within Google’s API.

      I hope this helps!

  187. All running and working thank you for the excellent plugin!
    I followed the tutorial to the letter and have only one issue – the authorization screen granted all permissions – not just gmail.send.

    I cannot find a way to restrict the scope in developer console for an already created OAauth client. Is this possible?

    Am using latest WP Mail plugin, up to date WordPress and G Suite for Business.

    Would I need to configure a different type of application than specified in the tutorial to restrict scope to gmail.send?

    1. Hi Sam,

      I apologize for any trouble with this! The reason that WP Mail SMTP must request additional permissions is that our developers found that in many cases, the Google API unfortunately wouldn’t work without these extra permissions enabled.

      If you’d prefer not to grant these permissions, you could consider using one of the other mailer options within WP Mail SMTP — all will work with Gmail/G Suite email addresses. If you decide to try another option, I’d specifically recommend considering Mailgun or SendGrid, as these are secure options.

      Thanks!

  188. Fantastic directions! I felt like you were here holding my hand all the way through. In fact, I’ve used several tutorials from the WPForms site as well as some Youtube videos. I’m pretty sure I found y’all via Youtube. Anyway… THANK YOU!!!

    1. You’re so welcome, Tracy! We’re so glad that our guides have been helpful to you, and it’s so kind of you to let us know 🙂

  189. Hi

    Mine is working perfectly, but the issue is that the from url is my private google account instead of the account i specified for my website. I have also checked the force from email and the force from name. still having the same issue.
    what’s the solution please

    1. Hi Kaycee,

      The best next thing to check is that nothing in your WP Mail SMTP or Google app settings is associated with your private Google account. For example, you’ll need to be sure that you set up the Google app using your professional email address, rather than your private one. Ultimately, emails will need to match in each of these places:

      1) Settings > WP Mail SMTP: From Email
      2) Email account used to set up Google app
      3) From Email in all plugins, etc on your site that send email (the Force From Email option should take care of this, but you could try manually adjusting these just in case)

      I hope this helps! If you’d like us to investigate 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!

  190. Hi! Sory to bother here. I wanted to test the plugin with Gmail, and when I accesed to our google api console,click on “create project” but it gets stucked on “enabling api”.. it never ends.. If I go to library / gmail api and click on “Enable” I get this error..

    Requests from referer are blocked.

    ANy idea why?

    Thankls!

    1. Hi Santiago,

      I apologize, but I can’t say I’ve seen this happen before. I’d suggest clearing your browser’s cache, and possibly even restarting your computer, to see if that helps to allow this to work properly. Or you could even try using a different computer/device altogether (or even a different internet connection, if possible) to see if that helps.

      Hopefully something along these lines helps this to work for you! And if not, you could also consider looking into a different mailer option within WP Mail SMTP.

    1. Hi Ankit – You can ignore this message, and proceed on through (click “Advanced”, then “Proceed”). Sorry about any confusion with that!

  191. I entered the FROM Email, and checked “Force From Email”, but the emails are still showing my Gmail e-mail address in the email heard From. Am I missing something?

    1. Hi Bryan,

      Generally when we’ve seen this happens, it’s been an issue with emails not matching up in all the places needed. Specifically, you’ll need to be sure that the From Email and the email account used to set up the app in Google are the same. Also, be sure to check that the Test Email is working to be certain that SMTP is functioning properly.

      If you’d like us to 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!

  192. This was one of the clearest explanations I have seen of working with a Google API. Their own documentation doesn’t make this much sense! Thank you for a job well done!

  193. Hi,

    I would ask if is it possible to use WP MAIL SMTP in a wordpress multisite, with one and a unique global sender method.

    To be more specific, I wish to use a unique gmail (or at last smtp) sender method to send email from all websites in a multisite.

    For what I understand I could define in wp-config.php the following constants:
    WPMS_GMAIL_CLIENT_ID
    WPMS_GMAIL_CLIENT_SECRET

    but I’m not sure if this is the right way.
    Also, Not sure if I could have problem with the Authorized redirect URI, that is different for each subsite.

    I suppose that this is not possible I can always use the smtp method.

    Any suggestions would be more appreciated.

    Thanks in advance, and congratulations for this wonderful plugin.

    1. Hi Virgo,

      Yes you should be able to define the constants in this way (assuming that you also add the Authorized Redirect URIs for each site). However, this approach may not be super reliable, and so we’d recommend sticking with the standard method (described above) for each site on your multisite network. While this may be time-consuming to set up, it’s the best way to ensure that everything works properly for each site.

      For the Other SMTP approach, that’s certainly an option as well. There are still potential concerns (multisite is prone to encountering odd issues), and so we still recommend setting up values on each individual site on the network. However, you can experiment with setting up constants to see if this works on your specific multisite setup.

      I apologize that I can’t offer a clearer picture of whether this might work for your specific situation, but I hope this helps! If you’d like to discuss options further, or receive support for multisite 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!

    1. Hi Punkuz,

      When you see this message, please go ahead and proceed (click “Advanced”, then “Proceed”). Sorry about any confusion with that!