Securely Send WordPress Emails with Gmail SMTP

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

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.

WPForms is the best WordPress Form Builder plugin. Get it for free!

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.

Open WP Mail SMTP settings page

At the top of this page, you’ll see the From Email and From Name. You can ignore these settings, because Google will automatically force these values to match the email account used in the next step.

To start the setup process, you’ll need to scroll to the Mailer field and select the Google option.

Select Google mailer option in WP Mail SMTP

Note: Google’s API (used by the Google mailer) will not allow you to customize certain aspects of your emails, such as the Reply To email address. If this is an important option in your project, please consider using an alternative mailer option.

You can skip the Return Path checkbox, as Google does not allow this setting to be altered.

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

Gmail section of WP Mail SMTP settings

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. In some cases, you may also be asked to agree to terms of service.

After filling out this form, go ahead and click the Continue button.

Create a new project for Google application

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

After clicking this button, Google will show a popup asking you to set up a consent screen. Go ahead and click on the Set Up Consent Screen Option.

Open OAuth consent screen

This will open a new tab or window. Be sure to keep the original tab/window open, as we’ll return to it a little later.

In the new tab/window, you’ll be asked for several details to prepare your consent screen. This is the permissions screen that will display to you later in the setup process (never seen by your users).

If you have a G Suite account, you’ll first set Application type to Internal. You will not see this option if you’re using an @gmail.com email account.

Select internal application type

For Application name, you can add the name of your website (or any other name that feels logical to you).

Fill in app details

Then, you can skip down to Authorized domains and add the URL for your website. Be sure to not include http:// or https:// here.

For Application Homepage link, Application Privacy Policy link, and Application Terms of Service link, you can again just add your website URL. You don’t need to have special privacy or terms pages in place for this app, as again this consent screen will only ever be seen by you.

Add authorized domain information to Google consent

When you’re ready, click the Save button at the bottom of this screen.

After saving your consent screen settings, Google will take you back to an API credentials screen. You can ignore this, and instead return to the first tab/window.

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

Note: In order to be certain that Google stores your data, enter the URL and then tap the Enter/Return key. When you see a trash can icon next to the URL, you’ll know it’s been stored and it’s ok to proceed.

Create OAuth client ID

When you finish filling out these details, you may see a Refresh button near the bottom of the page. Go ahead and click this.

Click Refresh button

Next, you can click the Create client ID button.

Click blue button to create OAuth client ID

You’ve now successfully created a Google 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.

Click Ill do this later

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

Click pencil icon to see details

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

Copy Client ID and Client secret

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

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.

Provide permissions to your Google app

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 See a Screen Saying “This app isn’t verified”?

When you click the Allow plugin to send emails using your Google account button, Google might display a screen that says “This app isn’t verified. This app hasn’t been verified by Google yet. Only proceed if you know and trust the developer.” There’s no need to worry, though — the message is only referring to the app that you just created in your own Google account (so you are actually the developer in this case).

To bypass this message, you’ll need click Advanced and then Proceed.

This app isnt verified error

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 world’s best WordPress forms plugin today.

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

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.

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 2 million websites choose WPForms as their preferred online form builder.

    Syed Balkhi
    CEO of WPForms

  2. This plugin is awesome! Thank you for the tutorial.

    I was with problem to integrate Contact Form 7 and I found you!

    Thank you!

    Samuel Nasser [URL removed]

  3. Hi there,

    I have an issue. Every time I receive an email through my website on Gsuite when I want to reply, instead of replying to the client, I basically reply to myself.
    So every time I have to copy and paste my clients’ email address to be able to reply to their email. It’s quite annoying. Is there any way I can avoid this? Many thanks, Valentino

    1. Hi Valentino – Our team is still looking into this, but it appears that Google recently changed something here (possibly they no longer allow a custom Reply-To email to be applied). We’ll continue to try and sort this out!

      1. Hi Brandon,

        Unfortunately this issue looked to be more on Google’s end rather than the WP Mail SMTP regarding unauthenticated emails that their services may have marked as suspicious. I apologize for the inconvenience!

      2. Hi Scott,

        Unfortunately this issue seems to be more on Google’s end regarding unauthenticated emails that their services may deem suspicious. I apologize for the inconvenience!

  4. Hi Mike,

    I apologize for the confusion here. When Google displays this message, they’re actually referring to this app that you just created within your own Google account (not WP Mail SMTP). So you can just go ahead and proceed.

    Hope that helps!

  5. Hi there,

    I have installed the WP Mail SMTP Plugin, but I am not able to change the email address (“From Email”) and the name content (“From Name”). Further, I can’t check the “Return Path”. Kindly advise on how to fix these issues. Thank you very much in advance.

    Wishing you a prosperous 2019 !

    Best Regards,
    Michael

    1. Hi Michael,

      These are limitations created by Google’s API, unfortunately. However, if you choose any of the other mailer options within WP Mail SMTP you’ll be able to change these options.

      Hope that helps! 🙂

  6. This article was so helpful! It walked me through step by step perfectly and I was able to set up an email for my blog! Thank you so much!!

  7. Using ninja forms and it still won’t send emails — I have no idea where to change SMTP from localhost to WP SMTP… the test email is sending fine from your plugin via Google oAuth. Any ideas about ninja forms??

    1. Hi Dan,

      Thank you for pointing this out and I apologize for the confusion! We’re always revising and updating our guides but it is possible that we sometimes miss a few things especially if something changes on a 3rd party’s side. We’ll go ahead and review this article and update it accordingly.

      I apologize for the inconvenience! In the meantime if you’re still having difficulties setting up SMTP please contact our support team.

      Thanks!

  8. I already have one site working completely. I was adding a second site and receiving this from google while trying to create new credentials for the new site:

    Invalid Redirect: You are using a sensitive scope. URI must use https:// as the scheme.

    1. Hi Dan,

      I’m sorry to hear you were having difficulty with this and I apologize for the inconvenience! Per your previous comment, we’ll go ahead and review the guide we have up on our site to update it accordingly and in the meantime, if you still need assistance with this please contact our support team.

      Thanks!

  9. Ive got this message:

    400. That’s an error.

    Error: redirect_uri_mismatch

    The redirect URI in the request, http://vaico.com.co/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/396175685103-uuoos8onmol7d1n5fk84q45bqafoo9mp.apps.googleusercontent.com?project=396175685103

    I’ve done the tutorial twice, paying extra attention to copy&paste steps the 2nd time I did ti and still it doesn’t work. Is there something else I can do?

    1. Hi Manuel,

      I’m sorry to hear you’re having difficulties setting this up. If you’ve already gone through the tutorial twice and made sure to copy & paste the information correctly, the next best step would be to contact your site’s hosting provider. Many SMTP issues are often a result of server configuration issues which won’t allow your site to communicate with Google. Your host should be able to help resolve the issue if that’s the case.

      If you need any additional assistance with debugging the issue and you have a paid license, please feel free to contact our support team. 🙂

  10. I am having trouble. I have followed the tutorial and everything seemed to work properly until i had to log into my gmail. I am getting a message from google that says I am using an unverified app. According to Google, a wordpress application doesn’t need verification but it isn’t working. I’m not sure it is the plugin, but I need help.

    1. Hi Franky,

      Usually this type of error has been a result of a mod_security issue on the server, which means that the site’s server is preventing 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 contact our support team! 🙂

  11. Hello, thanks for great tutorial. I have a business level subscription to GSuite (only 1 user – say john@domain.com)
    I have this website named domain.com and I’d like to send out messages from my web app (from address should be admin@domain.com). It seems my API at Google only allows sending out messages from john@domain.com

    admin@domain.com is not a real account, it is an alias for john@domain.com. Do I need to use another SMTP provider in this case?

    Thanks

    1. Hi gsuite user,

      In order for SMTP to work the From Email and the email used to set up SMTP always have to match no matter which mailer you use. This is because one of the main ways that SMTP works is by authenticating the email that is sent. So in this particular case, what you’re trying to do wouldn’t be possible.

      I apologize for the inconvenience but I hope this makes sense!

  12. Hello,
    I am trying to configure the plugin with Gsuite, I followed all the steps, in the last step to give permission to the plugin on Gsuite, it shows me a 404 error page on my website. I have read other comments that have had the same problem but I have not read about any solution, do you know any solution? thank you!

    The version I am using is a 1.4.1

    1. Hi Felipe,

      If a 404 error is being displayed, it’s usually the result of some sort of configuration issue on the site’s server. The next best step would be to contact your site’s host and hopefully they will be willing to investigate this further on their end, as the issue will be specific to their server setup.

      You might also consider trying a different mailer option within WP Mail SMTP. In many cases, we find that an error encountered by one mailer will be avoided in another, since they each work differently. In case it helps, you can find setup tutorial links for the other mailer options here.

      If you have any other questions please contact us over in support! 🙂

  13. Hello,

    If I use my primary G Suite email to connect via API, as sender I can see in the received mail what i have selected in “From Name” at the settings

    If I use a alias mail (of the primary mail) then the “From Name” is empty and only the mail appeared.

    Any suggestions?

    Thank you!

    1. Hi Aris,

      It is a little odd that your alias email went through since generally these don’t work with SMTP. For best deliverability, we recommend only using the email used to set up SMTP as the From email. Gmail/G Suite keeps full control over the From Name so even with a regular Gmail/G Suite email address, the From Name can only be adjusted from within your Google account.

      I hope this helps! 🙂

      1. There has been a fairly recent change in this. My old site that has WP form SMTP set up over a year ago is sending all emails with a Gsuite domain alias e.g. info at branchdomain. This was set up in the WP forms settings.

        Setting this up again for my second branch and gsuite only allows emails to be sent from admin email e.g. info at umbrellacompany.

        There is a workaround to create a second user in Gsuite with a different domain, but that costs another seat in Gsuite.

      2. Hi Arttu,

        Thanks for the update! I haven’t personally run into this situation before but I’ll go ahead and mention it to our team so we can do some digging and look into it further.

        Thanks!

  14. OMG!!! After days of going back and forth trying to figure out some mail delivery issues. I found this app and your instructions were a perfect help. I got it right on the first attempt!!! Thank You Sooooooo much. All other advice on the internet is completely outdated. Thank man

  15. My webhost is supporting the PHP mail function.

    In wpforms Notifications settings I have set up “From Email” field like this:
    contactform@mywebsite domain.com

    So all the contactform mails are sent using an email address with the sme domain name as my website domain itself, for example:

    website= mywebsitedomain.com
    From Email field= contactform@mywebsite domain.com

    With these settings, and with my webhost supporting the PHP mail function, do I still need to use the WP Mail SMTP plugin?

    Thank you for your help 🙂

    1. Hi Alwin,

      Great question! PHP mail() is only part of the potential issues with email delivery and in plenty of cases, the issue isn’t in the server but at the point when the email reaches it’s destination. When this happens, the recipient’s email provider will have to determine whether the email is spam or not. The WP Mail SMTP plugin allows your emails to be authenticated so that the email provider won’t filter them out as spam.

      Many users won’t ever have the need to use something like the WP Mail SMTP plugin but we still always highly recommend it since sometimes email delivery issues will start really suddenly. So, by installing it ahead of time, you’re proactively working to prevent the issue.

      I hope this helps! 🙂

  16. Hi, I need to change the email used in the From Email field and I cannot do it, it appears in grey and cannot be changed.
    Thanks

    1. Hi Geronimo,

      Unfortunately there isn’t a way of changing the From Email field once SMTP has been set up. What you’ll need to do is remove the connection and complete the setup again, this time with the new email address in that field. I apologize for the inconvenience but I hope this helps!

      1. Well how do you reinstall it then, the email address is grey, I’ve clicked the uninstall checkbox, saved the settings, and nothing happens. Arghhh!

      2. Hi Alysia,

        Under the mailer option, try selecting “Default (none)” and then click the “Save Settings” button at the top of the screen. That should allow you to make a change to the “From Email” field at the top that was previously gray. You can then select the Gmail option again to go through the setup process once more.

        I hope this helps!

  17. Thanks this does work to send email with BlueHost.

    As of late 2018 November or December the webclient to view GMail (Gsuite) email has an issue where when you reply to an email from a contact form you are replying to yourself as in the email address registered in the API APS process.

    Before using this plugin and with another host we were able to override the “From” email address which if set to an email address that didn’t exist fixed the issue.

    If I’m seeing the options correctly with this plugin (because of google) we can’t override the from email address and thus when replying via Gmails we client we are replying to ourselves. Maybe the fix is gmail fixing the issue?! Just a heads up for those using this solution.

    1. Hi Kinch,

      This is correct. Unfortunately due to restrictions from Google, the From Email address field can’t be overridden unless you remove the connection and go through the setup all over again. The Reply-To issue is something that has definitely been on our radar and our development team is currently looking into a fix for this. I apologize for the inconvenience!

  18. Hello

    I followed the steps but get this screen when i click the “Allow plugin to send emails using your Google account”

    400. That’s an error.

    Error: redirect_uri_mismatch

    The redirect URI in the request, https://www.clearlightdesigns.com.au/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/337742207591-ru7emq6ucog9ind3hg8uq9lnlm1cd1kh.apps.googleusercontent.com?project=337742207591

    Learn more

    Request Details
    That’s all we know.

    How can i set it up with out this error?

    1. Hi Callan,

      It looks like the Authorized Redirect URI isn’t matching correctly. Can you try copying that from your site (under Settings > WP Mail SMTP) into your Google App using the copy button shown in this screenshot?

      If that doesn’t work, try going back through each step in this tutorial (redo steps, recopy info, etc) to make sure nothing may have been missed. Afterwards, if you’re still getting this same error, you can try 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!

  19. Hi, I get to this step:

    Next, you’ll be returned to your WP Mail SMTP settings and a success message will be displayed.

    And that doesn’t happen. Instead, I get to my WordPress blog and it says page not found. It’s trying to go to a long url in the wp-admin area with tab=auth

    1. Hi Rincho,

      Due to some restrictions from Google, once you’ve set up the connection, you won’t be able to edit the From Email field. To change this, you’ll need to remove the connection to your site and create it again using the new email address. I apologize for the inconvenience!

  20. I tried doing this using the links and information provided but the “old” developers console kept “hanging” and showing a bunch of console errors in the google chrome browser. So I went ahead and did it on the new Google Cloud Developers console and it worked out. I think Google is changing a bunch of their services (I’ve noticed this in webmaster console as well – very big focus on “Cloud” now. Perhaps it might be a good time to revise the currency of your help page tutorial?

    1. Hi Ryan,

      Thanks for the suggestion! I’ve made a note of it for our team to review the doc and make any changes to it as necessary to keep it up to date. 🙂

  21. Daisy,
    Thanks for your reply. About the from email address and reply to not going to the person who submitted the form.
    Are you saying I can recreate all of this without the from address being a real address?

    I thought I tried that but wasn’t able to add/select something like no-reply….

    1. Hi Kinch,

      The SMTP plugin authenticates the emails that are being sent so in other words, it’s verifying that the email is coming from where it says it’s coming from. In this case, we wouldn’t recommend trying to use an email address that is not real when setting up SMTP.

      I hope this helps!

    1. Hi Musarrof,

      This error usually happens when the Authorized Redirect URI isn’t matching correctly. Can you try recopying that from your site (under Settings > WP Mail SMTP) into your Google App? It might be best to use the copy button as shown in this screenshot.

      Thanks!

  22. Hi… great article, but it seems that this now gives full access to read, write and DELETE ALL EMAILS from google! A bit overkill? Can I restrict this at all?

    1. Hi Richard,

      I apologize for the confusion and your concern is totally understandable. Unfortunately, however, our development team had to expand these permissions to allow the Google API to work on the majority of sites. The send permission alone prevented the API from working on many sites so this change had to be made. However, no data is sent to our servers about your site.

      I hope this helps!

  23. Lol, you should put a disclaimer on top of the page that says to ensure your site run in https first.

    I tried all those steps and it succeed, but sadly get this cURL error 60 since my site is running in http only.

  24. Hola, buenas tardes,
    He seguido paso a paso todas las instrucciones…
    Me envía correctamente el correo, con su respectivo aviso en verde,
    pero no llega a visualizarse en el correo receptor….

    Se visualiza que se ha realizado con éxito a la prueba, pero mando un correo desde el formulario de la website y no lo recibo en gmail.

    Muchas gracias de antemano

  25. Hello and thank you for this plugin. I have connected to Gmail and successfully created the Gmail app. I am receiving the emails, but they are not using the send from name denoted inside the app. Any insight here?

    1. Hi Michael,

      Great question! Using the API is more secure since with “Other SMTP” option, you’d have to enter your password right into the WP admin area. Both options will work but there is additional security by using the API. Additionally, many hosts block the SMTP ports whereas using the API doesn’t rely on using them at all, so you avoid this potential roadblock. It really is up to you what you’d prefer to use but there are pros and cons to both options.

      I hope this helps! 🙂

  26. I followed the instructions to the very end of this page to the “Allow plugin to send email using your Google account.” But instead of getting the “Hi WPForms” screen next, I got a Google red-triangle-and-exclamation-point page saying “This app isn’t verified” and directing me to linked pages that required a verification process that I couldn’t figure out. Spent a great deal of time this morning attempting to achieve the simple ability to have a WordPress contact page capable of emailing me. Nada.

    1. Hi Hoag,

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

      I hope this helps!

  27. This was a FANTASTIC walkthrough! Thank you so much – everything is up and running like it was before. Very much appreciate the help!

  28. Hi there,

    I have been experiencing this issue since last few days. Anytime a client registers on my website. It delivers to the inbox but once an order is placed on the website. It will be delivered to the spam folder. However, I had to change the email account handling the order placement function to the gsuite email address but I can’t still find notifications in either inbox or spam folder but notifications for new registrations still drop in my gsuite inbox. How can I fix this error?

    Regards,
    Dasola

  29. Hello there!! I followed the steps but it’s showing “This app isn’t verified”. What should I do to solve it??

    1. Hi Anindo,

      Usually when we see this message, you can click the “Proceed” option and continue on so that’d be the next best 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!

  30. If you are getting a 404 redirect_uri_mismatch error make sure you are not using Firefox with the privacy tracker blocking enabled. Use a chrome guest browser so you have to extensions on the browser and try again.

    1. Hi Gary,

      You can use the same Google API keys to authenticate the WP Mail SMTP plugin but you will need to add a redirect URL from another domain to the same project in the console.

      I hope this helps! 🙂

  31. Hi
    I’ve gotten to the very last bit where I “allow plugin to send emails using Google account”. Then I get ” 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”
    The only button to click is “Back to Safety” and it leads to a page describing how 3rd party sites and apps can use your Google account.

    What can I do now?

    Thank you

    1. Hi Rina,

      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!

  32. Hello.

    Followed the steps perfectly now getting the following error when I “allow” access from Gmail:

    Error:unauthorized_client Description: Unauthorized

    1. Hi Ryan,

      If you’ve already gone through the setup once more just to make sure everything was setup and entered correctly,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.

      I hope this helps!

  33. Hello
    I follow the steps in order to activate the SMTP but in the last step (
    Allow plugin to send emails using your Google account) an ERROR message is shown.
    the error is : Error: redirect_uri_mismatch
    what can i do to fix the problem?

    1. Hi Osama

      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?

      If that doesn’t work, 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 accidentally missed.

      I hope this helps!

  34. I was successful in creating a connection with my personal gmail email account. But I want to have my business name be the email. So I created a new gmail account, but I get to the “adding credentials” part and get stuck. I get this message: “Before you can create an OAuth client ID, you must set up an OAuth consent screen to let users know who is requesting access to their data.”

    I then click the link to “set up consent screen”. It leads me to my default personal gmail API console. I change it the new business gmail and then it says “You do not have sufficient permissions to perform the action on the selected resource” for the credentials.

    Do you think because its a secondary account? Is there something I need to do to the new business gmail account? Thank you for any help with this.

    1. Hi Rina,

      It seems like Google has made some changes to their application registration process that we weren’t aware of, hence why it isn’t mentioned in our step-by-step guide. We’re going to go through the process ourselves and then update the guide as soon as possible to provide instructions on what to do at this point in the process. I’m sorry about the inconvenience but I’d check back sometime next week for an update or please feel free to contact our support team. 🙂

  35. Hello,

    What should we do when we have this : 535 Incorrect authentication data

    I have follow the tutorial but when I test send email plugin say me it’s ok, but never email arrrived and google say me this : 535 Incorrect authentication data

    1. Hi Julien,

      If you’ve checked that your SMTP Username and Password are correct, this error generally results from overly strict server permissions, which your hosting provider should be able to help resolve. So at this point, I’d recommend you reach out to your site’s host to see if they can fix this issue on their end.

      I hope this helps!

  36. Hi
    I have a question once this is set up, how do you send mails throught code? Like calling it from a .js file or php.
    Thanks!

  37. I just recently started getting this pop-up in “Setting Up Credentials” step:

    “-Set up OAuth consent screen-
    Before you can create an OAuth client ID, you must set up an OAuth consent screen to let users know who is requesting access to their data.
    After you set up a consent screen, return to this page and refresh to create an OAuth client ID.”

    It won’t let me proceed until I answer a series of verification questions. It also stated that it could take Google up to 2 weeks to verify me for it?

    I have been using your amazing tutorial for about 6 months with my clients contact forms and had no problems. Is anyone else experiencing this or is there something I can do to bypass this? Thank you!

    1. Hi Justin,

      It looks like Google’s made some changes to their Credentials process that we weren’t aware of so we’re currently testing this process out ourselves and working on updating our guides to reflect what steps to take when setting up SMTP with Gmail. We appreciate your patience while we sort this out! 🙂

  38. Hello,
    I recently tried to configure GMAIL with WP Form, I successfully created the credentials and authorised the app however when I send a test email the sender is not the same email address that I configured the credentials with.
    I have a Gmail for business account and although I created the credential logging in with the account I want to send from, WP Form is sending from the email address of the GMAIL administrator.
    Is this something you encountered before?
    Thank you

    1. Hi Luca,

      You’ll want to double check the email address you have entered in the From Email field within the SMTP settings page on your site, as well as the email address that is in your form’s From Email notification settings. If you’d like your form’s notifications to show that they are being sent from the email address you set up the SMTP plugin with, try going to the SMTP plugin’s Settings and check the “Force From Email” checkbox.

      I hope this helps!

  39. Thank for the updated auth process. After pressing “Allow plugin to send emails using your Google account.” Google Chrome opens up the Information, that your app is unverified and we should contact you to verify it:
    https://support.google.com/cloud/answer/7454865

    Of course I can press advanced and skip the warning page, but nevertheless it would feel more secure, if you could just verify the app! 🙂

  40. Hi,

    I keep getting the following error code:

    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”

    Does anyone know why this is happening as I can no longer receive emails via my website.

    1. Hi Michael,

      This error usually indicates that there are permission issues due to the Secret Key (and all tokens that were generated using that key) being invalidated. This could happen when the Gmail password is changed or when 2FA is enabled.

      To resolve this you’ll need to regenerate tokens by going to the console.developers.google.com > Credentials page. Click on the Edit screen for your credentials and Reset Secret after that. Here’s the button you need to click.

      Alternatively you can go through all the steps in our setup tutorial again.

      I hope this helps!

  41. I just set up the Contact form using your tutorial for gmail, got by the OA, etc. The Contact messages are coming through OK, with one exception. At the bottom of the Contact email message there is a reference to:

    “This e-mail was sent from a contact form on …” followed by an outdated web address and an old invalid IP address.

    Can anyone tell me where this invalid info is coming from or offer some likely places to look? I don’t know if it is buried in WordPress or GCP or?

    Thanks in advance,

  42. Hi guys,

    I am getting the following error… I think it has something to do with an old gmail account linked to this but I can’t remove this. How do I get this to work?

    Error: redirect_uri_mismatch

    The redirect URI in the request, http://www.chcreativenz.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/686168456843-1vdikvu3k7ionjdhkj21emdtd0ooi6u9.apps.googleusercontent.com?project=686168456843

    1. Hi Craig,

      It looks 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?

      If that doesn’t work, 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 accidentally missed.

      I hope this helps!

  43. I’m using the Gmail Suite setup and yes, it is working.
    The issue is that those notification of forms are only showing up in my SENT folder and not coming to my INBOX.

  44. Hii,
    I got an error : Error. Page cannot be displayed. Please contact your service provider for more details. (10) When i allow my gmail account. pls help me how to solve the issue.

    Thanks!

    1. Hi Jignesh,

      You may want to go through the setup once more or contact your service provider for more details about the issue since they may be blocking your connection.

      I hope this helps!

  45. Thanks for this detailed article. It worked with G Suites, but I wanted to point out that if you are setuping this for your client G Suite and not your own, then please do so in an incognito tab, because you will receive an error in the authorization step (clicking the button) if you are logged in your own account.

    Just open the incognito tab and access your admin panel, click the button and then it will ask the G Suite credentials.

  46. About Error: redirect_uri_mismatch Solution .

    Whenever you are saving your Authorized redirect URI to the Google API QAuth screen , once click save , and click save it again.

    1. Hi Nadir,

      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!

  47. I wanted to thank you for these very detailed instructions! They really helped me and I would have had no clue how to set this up without this detailed information. Thank you

  48. Hi. We have your plugin installed and working successfully for gmail. Thanks! The only problem now is that our Wordfence alerts are going to the gmail address instead of to the email address defined in the Wordfence config. I noticed the “Do not send” option under the “Misc” tab, but that seems like it’ll just disable the plugin.

    How can we make our Wordfence email go to the correct address?

    1. Hi Eric,

      I’m sorry for the confusion and inconvenience! We tested this on our end but unfortunately weren’t able to replicate the issue. Could you please double check your email settings in WordFence and in the SMTP plugin?

      If you still need extra help after doing this and you have a paid WPForms license, please contact our support team.

      Thanks!

  49. Why can’t you modify your plug-in to collect the information and keep it on the website so that it can be downloaded? What good is adding your plug-in to my site if it doesn’t collect the information and store it for me? Very disappointed I spent any more to purchase your plug-in. Grrr. What a waste of my time.

    1. Hi David,

      I’m sorry for the frustration and confusion. If you’re referring to entry data, our free version, WPForms Lite, doesn’t store/save form data to your site and thus, that information will only exist in the email notification that is sent when a form is submitted.

      Again, we apologize for the inconvenience.

  50. Hello, I can not manage to
    I can not validate the last step
    “Allow plugin to send emails using your Google account”
    Here is the error when I arrive on the google window

    This app is not validated
    This app has not yet been verified by Google. Continue only if you trust the developer.

    If you’re the developer, send a verification request to remove this screen. Learn more”

    Thx for help

    1. Hi Deuns,

      Once you get to the “This app isn’t verified” screen, then please click on the “Advanced” option at the bottom and click the link to proceed.

      While it’s unclear why Google only shows this screen to some users and not others, the good news is that there’s no harm in going through those steps to proceed past it (since you made the app yourself).

      I hope this helps! 🙂

  51. After configuring the plugin following the guide above, I can click the “Allow plugin to send emails using your Google account”, which takes me through the authentication process with Google, and returns to the site with the message: “You have successfully linked the current site with your Google API project. Now you can start sending emails through Google.” Yet when I move to the Email Test portion, the Send Email button is red with the following message: “You cannot send an email. Mailer is not properly configured. Please check your settings.” I followed the instructions to the letter.

    1. Hi Mehrab,

      I’m sorry but I don’t understand your question. Are you asking about the number of email addresses you can use with SMTP?

  52. Hi Team, These instructions are really easy to follow thank you for that! I got all the way to pressing “Allow plugin to send emails using your Google account”. The next screen was my Gmail login, which I pressed. The next screen says “This app isn’t verified!” When I click on “Learn more” it sends me to a screen telling me what I just did per your instructions. I don’t know how to get past this loop. Please can you help me?

    1. Hi Cheri,

      If you could get back to the “This app isn’t verified” page, please click the “Advanced” option and then click the link to proceed.

      While it’s unclear why Google only shows this screen to some users and not others, the good news is that there’s no harm in going through those steps to proceed past it (since you made the app yourself).

      I hope this helps! 🙂

  53. 400. That’s an error.

    Error: redirect_uri_mismatch

    The redirect URI in the request, https://us-sabc.org/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/103766841045-k8f4loikk2as4eoglq77mkecm6bjnfpd.apps.googleusercontent.com?project=103766841045

    Learn more
    Request Details

    response_type=code
    access_type=offline
    client_id=103766841045-k8f4loikk2as4eoglq77mkecm6bjnfpd.apps.googleusercontent.com
    redirect_uri=https://us-sabc.org/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth
    state=
    scope=https://mail.google.com/
    approval_prompt=force
    include_granted_scopes=true

    That’s all we know.

    1. Hi Daniel,

      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.

      Afterwards, if that doesn’t work, try 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!

  54. Hi Daisy, thank you for your quick reply! I clicked on the “Advanced” link and this is what was revealed,

    “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” I clicked the “Learn more” and it took me to Google’s Help Center “Third-party sites & apps with access to your account” page. There didn’t seem to be anything on that particular page to help me get past the “Unverified app” page.

    Do you have any other suggestions?

  55. I setup all these steps and done it successfully. I use Gmail.
    Now please enlighten me how to use this Gmail with various other email blabla@yoursite.com email address?:
    – how to setup various different email address using ***@yoursite.com in Gmail
    – how to select and send email using each @yoursite.com email address

  56. That was impossible. What do you mean “It will take you back to a credentials screen. Ignore this and go to the first tab. What the heck does that mean.” I quit in the middle. Google is impossible.

    1. Hi PC,

      When you’re setting up the OA consent screen, your browser should open this page on a new tab. Once you’ve finished setting up the consent screen, you can close that tab and return back to the original tab where you were initially setting up the credentials.

      I hope this makes sense!

  57. I do not receive “Not Acceptable…” error but instead, I receive the following error:

    Forbidden
    You do not have permission to access this document.
    Web Server at [my domain]

    I contacted my host provider (Rebel) but they referred me to WPForms what can I do? So frustrated.

      1. I have the same problem:
        Forbidden
        You do not have permission to access this document.
        Web Server at [my domain]

  58. Hi Daisy,

    Yes!!! I followed you instructions and It worked!!!! A working Contact Form was the last piece I had to fix to be able to publish my website! Thank you so much!!

  59. I have added the Client id & Client Secret. When I am Trying to do this step Authorization
    Allow plugin to send emails using your Google account

    I go throught Gmail account as shown here but the last Step shows “403 Forbidden” which is redirected to the link

    https://www.zeelinternational.com/wp-admin/options-general.php?page=wp-mail-smtp&tab=auth&code=4/OgHYlQw5pRxXWvQZfWnj4FXv0IjEaJ2OaJfzEqrMWaeVfDIDMLtnsLtq6CC1CfyclFySJaTHDbD4E7zG2OiEgJY&scope=https://mail.google.com/

    not showing my actual wsebsite

    1. Hi Nisharg,

      I’m sorry to hear you’re having issues with the setup so far. 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.

      I hope this helps!

  60. Google removes the get request from the url when it redirects back to your site, so I get a mismatch error. So i manually copied back in the “&tab=auth” before the “&code” in the url after google redirects back. This worked and i then got the success message. However. The test email page still says its not setup correctly.

    Any idea?

    1. Hi Daniel,

      Can you go to the Email Test page of the SMTP plugin and try sending a test message? If and when an error message appears, can you check the debug log at the bottom of the page? That will give us a better idea of what the issue is.

      Additionally, if you have a paid WPForms license, please reach out to our support team so they can look into the issue further.

      Thanks!

  61. I made some mistakes on the “settings” screen, and need to make corrections to the “form email name” and I meant check all the check boxes. When got to the “allow authorization” I got an error 404.

    1. Hi Kayden,

      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.

      I hope this helps!

  62. Im getting the same as others above. Issue is that Google only supports URL that begin with https:// where as my link URL starts with http://.

    I cant enter the http address in Google, as they want a https:// address.

    1. Hi Peter,

      Can you provide some more details about where in the setup process you’re running into this problem? You should be able to use a URL that starts with http://

      If you have a paid WPForms license, please contact our support team so they can help you out.

      Thanks! 🙂

  63. I just wanted to say thank you for this beautifully written tutorial! 97 steps later and we are good to go. Very clear and concise. Many thanks.

  64. Hi,
    I was setting up the plugin and made some input mistakes, and work like to clear the input fields. I have checked the uninstall checkbox on the Misc screen and delete the plugin twice, but when I reinstall the plugin the input fields have the old data in them and I can’t change it. Please help.
    Kayden

    1. Hi Kayden,

      In the SMTP settings, try changing the mailer option back to ‘Default (None)’ and then switching it back to Gmail. That should allow you to re-enter any information you may have entered previously.

      I hope this helps!

  65. i want to send an email to my follower, how can i do that? I had configured successfully, but I can’t find out how to send an email normally

    1. Hi Tanh,

      WPForms will allow users to receive email notifications when they have submitted a form to you but it doesn’t offer any traditional email functions, such as being able to write and send an email to a user. I apologize for the confusion!

  66. so one’s would absolutely need a G suite account to configure credentials for localhost ? because without that option i don’t understand what URL i have to put, i’ve tried “localhost”, “http://localhost”,”127.0.01″… nothing works

    1. Hi John,

      I’m sorry to hear this hasn’t been working for you! Can you provide more details about which field you’re having difficulty with? Or, if you have a paid license, feel free to reach out to our support team and they can assist you further.

      Thanks!

    2. I have exactly the same problem. I have a local installation or wordpress (localhost) and I don’t know how to create the credentials in Google API, as it requires a first level domain and does not accept “localhost”

      1. Hi Andrew,

        A few of us use Local by Flywheel to create local sites for testing SMTP. Flywheel allows you to change the domain name to something else so that you can use it when setting up the Google API. But if you don’t use such a service, you might want to check out this post from Stack Overflow that might help you change the URL so that Google will accept it.

        I hope this helps!

  67. Hello,
    thanks for this tutorial but I have this Issues in the Authorization redirect from Google to our Website:
    “403 Forbidden – You do not have permission to access this document.”

    Please help us.
    Thanks.

    1. Hi Muhammad,

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

      I hope this helps!

  68. I’ve followed all the instructions up to the point where I click “Allow plugin to send emails using your Gmail account”, but clicking this just takes me to a page which says “Error: redirect_uri_mismatch, The redirect URI in the request does not match the ones authorized for the OAuth client.”
    I have double checked, and re-copied and pasted the given Authorized Redirect URI but it’s still not working. Could you assist me with this please?

    1. Hi Amy,

      If you’ve already gone back through the setup process to make sure everything’s been entered correctly, the next best thing to try is contacting your site’s hosting provider. Sometimes it’s possible that something on the server is preventing Google and your site from communicating properly. If that’s the case, your web host should be able to help sort that out.

      I hope this helps!

  69. I have the same error. What if i control the server and website? (it is a dedicated windows server) can you be less vague in what needs to be modified on the server. (i use apache) “mod_security issue on the server” doesn’t help.

  70. Not sure if this has been addressed, but you have to press ENTER, not SAVE on the Create 0Auth 2.0 Client ID section!!! Or you will get the 400 error, for the AUTH Redirect URI, same goes for the site URL, YOU MUST PRESS ENTER, not SAVE in Google when creating the APP! Really dumb, but that is the deal!

    1. Hi Web Guy,

      Thanks for letting us know! I’ll go ahead and forward your feedback to our team so they can review the doc one more time. 🙂

  71. I go until “Allow plugin to send emails using your Google account”. I followed all steps accurately. Then I get the 400 error. I made sure it was copied perfectly without extra spaces.

    What’s the problem? :/

  72. Great and useful article. I gave it to one of my new juniors and he said it worked from the first.

    Thank you.

  73. Hello,
    What do I need to do if I want to use gmail smtp for multiple emails from the same website?
    I use 2 different gmail accounts, but all accounts send from the same email adress .
    I use 2 accounts, because it is better for my organization. 1 for my clients, 1 for my requests. Thanks

    1. Hi Tobias,

      The SMTP plugin can only be used with one email address. You can still have the form notifications be sent out to different email addresses (so say, for example, you can include both the client email address and your own email address in the Sent Email To field in the form’s notifications) but the email address the notification is from will always be the email address that is listed in the SMTP plugin’s Settings page.

      I hope this makes sense! 🙂

      1. Thanks so much Daisy, great support here 🙂 I really appreciate it. I have one more question. Right now it seems like only my gmail adress (F.e. tobias@gmail.com) is using the SMTP plugin, is it possible to use also my business email: tobias@mywebsite.com ? So to say an email adress which includes my website and not “Gmail”? Thanks

      2. Hi Tobias,

        If your business email is still technically a gmail email account then yes, you can use it (although you will need to redo the entire setup with your business email instead since you can only use one email address at a time with SMTP). However, if your business email is not Gmail, you’ll need to use the Other SMTP option within the plugin’s settings.

        I hope this helps!

  74. THANK YOU SO MUCH!!! I have been trying to figure this out for a week!!! Bless you for such great and thorough instructions!

    1. Hi Taha,

      You’ll want to make sure that, after filling out the Authorized Domains field, you press Enter to add it. It should appear like this once you’ve done so.

      Can you try that and let us know how that goes?

      Thanks!

  75. Thank you for these instructions. After setting up, I am able to receive the email from the website as intended, but I also get an error email at the same time saying:

    “Address not found
    Your message wasn’t delivered to johnc@[domain.com] because the domain [domain].com couldn’t be found. Check for typos or unnecessary spaces and try again.”

    It then references: “DNS Error: 638397 DNS type ‘mx’ lookup of [domain].com responded with code NXDOMAIN Domain name not found: [domain].com”

    Any ideas?

    1. Hi JC,

      It sounds like you’re using a G Suite email, and so I’d recommend checking the MX records for your site (Google would have had you add these when you set up G Suite).

      G Suite’s support should also be able to help you check over your configuration there.

      And if neither of these options helps you get a fix, I’d recommend trying a switch to Mailgun instead. Sometimes when one mailer runs into an odd issue like this, a different mailer will be able to avoid it (since it uses a different API). But please do be sure to look into your G Suite configuration first to be totally sure there are no issues there.

      Hope this helps! 🙂

  76. If the client changes their password for Gsuite, the api get’s revoked.

    Has to be reset up again from scratch.

    1. Hi Christina,

      Google’s API unfortunately has gone through a series of changes, and the result is that some of these older comments no longer apply. I’ve let our team know to check into this so we can be hopefully avoid misleading anyone.

      I’ve also made a note to make sure this article gets updated so we address this issue.

      Last, if this is a point of concern (especially if you’re setting this up for a client, and so you likely will not know if they change their password), I’d recommend switching to the Mailgun mailer instead. Mailgun will not be impacted in any way by a chance in email password, plus its super reliable. Hopefully this would save you frustration!

      1. Thank you for this detailed instruction. I’m a beginner website builder and am a bit stumped because the google interface seems to have changed. Many of the areas don’t match what I’ve actually found. I appreciate any updates you can make. Thank you again!

  77. Hi, thanks for great job you guys are doing. I want to send an email from a custom PHP file, I tried to use wp_mail() and mail() function to send email unfortunately none of them worked for me, I installed wp mail smtp and set up gmail successfully please tell me which function should I call in my custom php file to send an email , if you could post a sample code that would be great.

    1. Hi Mehdi,

      In order for WP Mail SMTP to apply, you’d need to call the wp_mail() function. There are other considerations also, though. I’d recommend checking out this WP Mail SMTP forum thread for some extra details.

      Hopefully that helps get you on the right track!

  78. Wow ! It worked like a charm. Thanks WP-Forms team. I was using Easy WP SMTP for quite sometime, but for past 1 month somehow with all right settings mails were not being sent.

    Luckly, this plugin.

    Thanks once again.

  79. Thank you for saving my life!!! 🙂 It works! Thanks a lot to a great team!! Congratulations for your step by step guide….

  80. I got this working, but I’m concerned that Google is sending me an email to “Remove risky access to your data” because the developer is not verified. I know I am the developer, but could this expose my Gmail account if my wordpress site is compromised/hacked? Is there a way to limit the scope of the app’s access to my gmail to only read/write and not delete?

    Thank you!

    1. Hi Josh,

      Unfortunately there isn’t a way to limit the app’s access to only read/write emails and not delete them. Our development team had to expand these permissions to allow the Google API to work on the majority of sites. The send permission alone prevented the API from working on many sites so this change had to be made.

      I hope this helps!

  81. I don’t normally comment on helpful articles, but your article was so detailed, precise and explained all the steps so clearly. I could not have managed without it, as the process of setting up the plugin is so complicated. Thank you very much!

    1. Hi Nha,

      You may want to reach out to your hosting provider in this case to see why the plugin is being blocked. Hopefully they can either reverse this or provide more details on why this is the case.

      I hope this helps!

  82. Thanks,

    When I click on “Allow plugin to send emails using your Google account” I get the following message:
    403. That’s an error.

    Error: org_internal

    Application: www.***********.co.uk

    You can email the developer of this application at: admin@***********.co.uk

    This client is restricted to users within its organization.
    Request Details

    That’s all we know.

    I’ve gone through the process twice. Any idea what I may have missed?

  83. The contortions required to set this up in Google are a little ridiculous given that this is basically just a substitute user/pass for Gmail…

    1. Hi Scott,

      I totally understand your frustration and I apologize for the inconvenience in setting this up. Unfortunately, however, a lot of this is due to required processes from Google rather than just the WP Mail SMTP plugin. That being said, I’ll forward your comments to our team for them to consider as they plan any future updates to the plugin to see how we can simplify this process for our users. We really appreciate your feedback!

  84. Hello,

    I have 1 site already set up with a different domain name.

    When entering the authroized redirect URIs I’m getting the following message:

    Invalid Redirect: duplicate domains are not permitted.

    Please help.

  85. everything went well, so am asking, how can i reach users? must use wpforms? what other forms do need to take some leads? please help

    1. Hi Sunday,

      I’m sorry but I’m afraid I don’t quite understand your question.

      You can use WPForms to allow users to submit information, such as contact info or inquiries, to you or even have them sign up for your site’s newsletter, if you’d like.

      I hope this helps!

  86. I installed the plugin, the Gmail API connection was set perfectly, and I also received the email test from WP Mail SMTP. But finally I can’t configure Contact Form 7 with the Gmail address in “FROM”. It says: “Sender email address does not belong to the site domain”. So, how can I solve this? With my domain email, Contact Form 7 is not working anyway. Thank you.

    1. Hi Kramer,

      Unfortunately you may need to contact the Contact Form 7 support team with this particular issue. I apologize for the inconvenience!

  87. Hi,

    I can get the WP Mail SMTP setup and sending ok. However when I goto my site the contact form (Contact 7) comes up with email problem when I click send. Please can you advise

    1. Hi Martin,

      I’m sorry to hear you’re having trouble with this. I have a few suggestions for you that might help:

      Please be sure to check the FROM EMAIL field in Contact Form 7 and the From Email field in the SMTP settings are the same address since having two different addresses in these fields can cause email deliverability problems.

      Additionally, you’ll want to make sure that everything within your Contact Form 7 settings has been configured correctly. In case it helps, please check out this article from Contact Form 7 that goes over best practices to set up mail. You may also want to check out this article which shows you how to set up your mail settings in Contact Form 7.

      I hope this helps!

      1. I don’t know how Contact Form 7 can work with WP mail SMTP, since:

        1. CF7 refuses to accept any originating email that isn’t on the same domain as the CF7 plugin.

        2. If the webhost doesn’t allow PHP mail(), which is the primary reason WP Mail SMTP exists in the first place, the user can’t send email via the webhost server, which means the source email CANNOT be from the webhost domain.

        3. AFAICT, the Google API requires the originating email be a Gmail one, which means the CF7 criteria cannot possibly be satisfied.

        Round and round she goes. Catch-22. Simply put, unless I’m missing something here, WP Mail SMTP’s scheme cannot work with CF7, at least not with Gmail.
        Let me guess. The WP Mail SMTP devs know this and the WPForms plugin doesn’t require the originating email be from the same domain – sneaky, but probably effective way to get people to use WPForms.

      2. Hi Chip,

        You might want to try using a different mailer, like Mailgun or SendGrid, for example. These two options require adding DNS records to your site which might help meet the Contact Form 7 requirements in a way that the Gmail option can’t.

        Additionally, I’d recommend possibly contacting Contact Form 7’s support team for more details on how they might recommend using the SMTP plugin with your forms.

        I hope this helps!

  88. Well, I went through the whole routine, and the screen after the test e-mail said, “you cannot send an e-mail, your mailer isn’t properly configured, check your settings.”

    I can’t even begin to know where to check.

    So much for forms being easy to set up. I feel like an old lady.

  89. Oh man this is awesome! Thank you so much. I was trying to get around the fact that AWS Lightsail WordPress instances do not have a mailserver. This worked out perfectly and my Contact 7 Form is going now!

  90. Set up and installation worked however, all email is still going to spam.
    None of the images are appearing in the test email or my store logo.

    Any suggestions?

    1. Hi Maxim,

      I’m sorry to hear you’re having trouble with this. In this case, however, you may need to contact your site’s host to resolve any permission issues since it sounds like this is on their end and they’re blocking the connection needed to finish the SMTP setup.

      I hope this helps!

  91. I see a number of people have posted about running into 403’s – but no solutions posted.

    I am running into 403 for a number of sites after clicking “Allow plugin to send emails using your Google account”, then “allow” in Google.

    The specific message says 403 Forbidden – Access to this resource on the server is denied.

    Any suggestions on how to fix?

    1. Hi Matt,

      I apologize for the trouble! 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.

      I hope this helps!

    1. Hi Jake,

      If you’ve gone through the setup steps to set everything up in your Google account, you should see a red “Remove Connection” button at the bottom of the SMTP settings page.

      If you don’t see this, please go through the setup steps once more just to make sure that nothing was missed.

      Thanks!

  92. i’ve got an error there is still those sort of message : Gmail doesn’t allow to override From Email. Emails will be sent using the email address you used to setup the connection.
    Plus when i want to send an mail, a message appear : You cannot send an email. Mailer is not properly configured. Please check your settings.

    i can’t do anything and i don’t really understnad if you could help me it would be superb
    thanks a lot for your time

  93. Hello Shahzad,

    Congratulations, excellent tutorial, detailed and accurate!

    It was of great help to me.

    Thank you very much,

    Success always!

    Regards,

  94. I completed this but am now utterly confused. I have one gmail address and this new wordpress email. I was able to send a test email from your application to the gmail. However, when I tried to send an email from the gmail account back to the wordpress email I get an error : 550 Please turn on SMTP Authentication in your mail client. mail-qt1-f174.google.com [209.85.160.174]:46636 is not permitted to relay through this server without authentication.

    I am not sure if this is the problem you are speaking of. If it is, what is the workaround? If none how is this entire process useful if I cannot get an email?

    1. Hi Sean,

      It sounds like this might be a different problem. Let’s say the two email addresses are sean@gmail.com and wordpress@websitedomain.com. WP Mail SMTP is probably set up with the address sean@gmail.com, which successfully sends out the test emails.

      However, when you try to send an email to wordpress@websitedomain.com it fails because email for your website domain is not setup yet. Remember that wordpress@websitedomain.com is the default address WordPress well send internal emails from, like comment notifications, etc. So you may want to go back and make sure that the email for your website domain is set and read to go.

      I hope this helps! If you still need extra help with this and have a paid WP Mail SMTP licence, please feel free to reach out to our support team. 🙂

  95. Thanks for this helpful article. Everything went according to plan until I clicked ‘Allow” to give permission for this site to send email on my behalf. I get an error message: “The site is experiencing technical problems. Check the admin e-mail inbox of your website for instructions”.

    But after waiting for some time I haven’t received any messages in my inbox or spambox. Do you have any idea what could be the problem?

    Thanks in advance.

    1. Hi Juri,

      You may want to contact your site’s host to see if they can shed any insight on the issue since, based on that message, it sounds like it could be a server-side problem.

      I hope this helps! 🙂

  96. Hello there, I am having an issue where WordPress would send out email to team members as “webmaste@”, where it suppose to be “hot@”.

    Do I need to reconfigure the set up again and connect to Google Suite as hot@ instead of webmaster@ so all the emails will be sent from hot@?

    1. Hi Samuel,

      Yes, you’ll need to go through the setup one more time in order to change the name in the From Name and From Email fields of the SMTP’s settings page.

      I hope this helps! 🙂

  97. I followed this tutorial (very good, by the way). The test email worked.
    When I use it in the wordpress application (Fluent Form), the notification seems to work. The successful entry message appears. However, when I look at the details of the specific of the entry, I find the following message:

    Email Notification may failed to deliver to [**my email**]@gmail.com and the subject: Workshop Registration for [**subject**], Please check your SMTP/wp_mail functionality/configration
    —–the spelling mistakes are in the message!
    Anyway, not sure what to do now. everything seems to be set up as it should be.
    I looked around for things that could be unusual and I noted under the word press settings > general that the admin email address is a different address than the one I set up using WP Mail SMTP. Can you suggest anything I should do?

  98. hello
    I have setup the WP Mail SMTP by following each and everything in this article.
    When i sent a test email it will sent successfully and i received it on my gmail account, but I’m facing a problem, when i submit a form from my website “contact us page” it shows sent successfully but i do not receive any email to my gmail account.
    Please help …
    Thank you

  99. Hello,
    Great tutorial. I’m stuck at the
    “Application Homepage link, Application Privacy Policy link, and Application Terms of Service link” step.

    When filling in my website URL including https:// it says:

    “Invalid Domain: The URL must be hosted in a domain listed in the “Authorized Domains” section.”

    I’ve added my site in the tab “Domain verification”. Where should I add it?

    Thanks a lot!

    1. Hi Jim,

      You’ll want to make sure that you enter the website URL in the field provided and it should then appear right above it. The red arrow in this screenshot shows where you should enter the URL and the red box shows where it should appear.

      I hope this helps! 🙂

  100. Hey guys, love this plugin however have noticed recently a few client sites have broken unexpectedly when using Google. It appears this is due to a change in password, however I was under the impression that using the API meant this would work regardless of the password? Is it possible to make it work this way, or any other suggestions that would work?

    1. Hi Pete,

      If you’re using the Gmail mailer option then you’ll need to reauthorize your account since the password has been changed. Additionally, if you make a change like enabling or disabling 2-factor authentication that will also require you to re-establish/reauthorize the connection too.

      I hope this helps!

  101. i think i followed everything correctly but i recieve this message on the very last step…can you help tell me where i went wrong
    cheers

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

    1. Hi Ben,

      I would recommend reaching out to your site’s hosting provider to see if they assist you further as this error seems to be a server permission error. I apologize for the inconvenience!

Add a Comment

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