how-to-send-wordpress-emails-using-gmail-smtp-with-wp-mail-smtp_b

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

Here’s a table of contents to help you work through the steps to set this up:

  1. Install the WP Mail SMTP Plugin
  2. Create a Web Application for Gmail SMTP
  3. Grant Permisions and Send Gmail SMTP Test Email

But first, let’s look at the reasons why you aren’t receiving email from your WordPress forms.

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 the PHP mail function. Regardless of if you’re using unmanaged or managed WordPress hosting.

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

In addition to this, anti-spam efforts by email providers can impact your emails as well.

spam blockers cause email to not be delivered

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 for Gmail SMTP?

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

Important: If you’re looking for a seamless experience setting up SMTP, our official recommended mailers include Sendinblue.

SendGrid and Mailgun are also reliable options. There tends to be some compatibility issues with Gmail and different site servers, and it isn’t as easy to use as some of the other mailers.

But if you’d still like to use Gmail or G Suite, let’s go ahead and take a look at how to set up WP Mail SMTP for sending WordPress emails using that mailer.

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 WP Mail SMTP » Settings and scroll down to the Mail section.

from email

Here, you’ll see the From Email. Check this box.

Scroll down and you’ll see the From Name setting. This you can customize.

from name settings

The From Name is the name associated with emails sent out, and is set to your site’s name by default. You can adjust this to anything you’d like. You can also check the Force From Name option to apply this setting site-wide.

To start the mailer setup process, you’ll need to scroll down a bit further to the Mailer section and click on the Google option.

WP Mail SMTP mailers with Google selected

Important: Gmail’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 important to you to control, consider using an alternative mailer option. You may also want to consider a different mailer if you expect to send a high volume of emails, because Gmail’s API has rate limitations and a number of additional restrictions that can lead to challenges during setup.

If you are continuing your Gmail mailer setup and not selecting a different mailer, next we recommend checking the optional Return Path checkbox to Set the return-path to match the From Email. With this enabled, you’ll be emailed if any messages bounce as a result of issues with the recipient’s email.

check set return path

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

gmail mailer 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 for Gmail SMTP

To create an application, you’ll first need to click here then sign in to your Gmail account and access Gmail’s application registration. This link should launch a new tab for you, so keep your WP Mail SMTP settings tab open because we’ll be coming back to those later.

Note: If you’re using G Suite, make sure that the Google account you use has email sending permissions (in other words, access to its own inbox).

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 project

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

enabled the api

On 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 your 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. It’s never seen by your users.

If you have a G Suite account, you’ll first set the Application type to Internal.

You will not see this option if you’re using an @gmail.com email account.

select the 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 application details

Then, you can skip down to Authorized domains and add the URL for your website. Be sure not to 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 info

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 copy to authorized redirect path

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

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 on ill do this later

Step 3: Grant Permissions and Send Gmail SMTP 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 your client id and client 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 emails on your behalf.

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

allow permissions with 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-new

Once the Test Email tab is open, you’ll need to enter a valid email address and click the Send Email button. You can use your business email address here if you want to. 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.

confirmation message

FAQ on Gmail SMTP

Below are some commonly asked questions to help you navigate the Gmail SMTP setup even further.

What If the Gmail SMTP Test Email Fails?

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 it, copy in the Client ID again and be careful not to 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 this, 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 Gmail SMTP 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.” But don’t worry — the message is only referring to the app you just created in your own Google account (so you are actually the developer in this case).

None of the above
If your test email fails without an error message, your Gmail API might be disabled. To enable it, follow Google’s guide on enabling an API.

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

this app isn't verified error how to fix

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

Final Thoughts

That’s it! You’ve successfully configured WP Mail SMTP’s Google mailer on your WordPress site.

Now that your emails are sending perfectly, it’s time for explosive website growth. You can start by hosting a giveaway on your website and trying some easy tips to reduce form abandonment.

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. Hi Evan, I apologize for any confusion!

      Please double-check if you have allowed to plugin access your Google account through the API under WP Mail SMTP Settings. If you didn’t allow it, there should be an orange button to allow it.
      However, if this doesn’t help, if you have a WPForms license, you have access to our email support, so please submit a support ticket.

      Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.

      Have a good one 🙂

  1. Hey. I’m trying to use WP Mail SMTP with my G Suite account. I have done everything step by step, but when I’m on the page asking Google for authorization on using the plugin, it does nothing. I’ve clicked the “Advance” link and the Google Pop-up appears, then I click “Allow” and its all fine, but back on the WP Mail SMTP Settings Menu the button is still orange, like I didn’t do anything.

    Can I get any help? Thank you!!

    1. Hi Gaby, thanks for reporting this!
      Normally if everything is done according to the tutorial it should work properly. However, when we see the issues like this we recommend trying the connection process from scratch, it is easy to miss something so it’s good to try it again.

      In case it still doesn’t work, and if you have a WPForms license, you have access to our email support, so please submit a support ticket.

      Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.

      Thanks, and have a good one 🙂

  2. Hi, thanks for putting together this VERY helpful tutorial. I used it a little over a year ago and my contact form has been great until recently. All of a sudden, it stopped working, but the test function works. I have not made any changes to my host server or website in anyway. Any idea on why the test is working but the contact us form does not? The form allows visitors to submit without any errors, but the email never arrives to me nor is it in junk. I dont think its due to the limitations as i dont get more than 30 or so visitors a month, only a few may use the contact form. I am using G Suite. Thanks for any help you can provide.

    1. Hi Joey!
      If you were able to send a test email successfully, it sounds like your WP Mail SMTP settings are all set. The next step from here is to check the notification settings of your form.
      Specifically, the From Email field in the form notification settings (in the form builder under Settings > Notifications) must be set to the same email address as the email used to set up the SMTP plugin. If you have more than one form, this setting will need to be changed in each form.
      I hope this helps! However, if you will still have any issues with this, please write to us in the support forum. And if you have a WP Mail SMTP license, you have access to our email support, please submit a support ticket.

      Have a good one 🙂

  3. I keep getting an error 400, after authorization.
    It says that the URI doesnt match the ones authorized for the Oauth client!? :O

    Tried three times from the beginning – same error every time

    What t o do?

    1. Hi Danny, I hope you are doing well.
      Normally, when we see such issues, users could fix this by trying to set up a connection from scratch.
      I apologize for any inconvenience, however, if you still having this issue and you have a WPForms license, you have access to our email support, so please submit a support ticket.
      Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.
      I hope this helps.
      Have a good one 🙂

      1. Hello. I think I received this message the first time when the WordPress site that I was using was being edited with a user profile that was different to the Google account that I was authorising. If this is the case for you, try opening the console.developers.google.com link provided in this procedure in a Google profile that is open in the Gsuite/User account that is being authorised.

      2. Hi Richard,
        glad to hear that it works, and thanks for letting us know!

        Have a good one 🙂

  4. How to fix it ?

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v1.8.1 logged this error during the last time it tried to send an email:

    Mailer: Gmail
    {
    “error”: “invalid_grant”,
    “error_description”: “Token has been expired or revoked.”
    }

    1. Hi Yudas.
      I hope you are doing well!

      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.
      Have a good one 🙂

  5. Hey! It’s me again.

    I have another issue in regards Gmail and SMTP… I’m using SendinBlue and it works good, but I’m not sure if there is something between using G Suite and SendinBlue, because I receive the “Test Mail” to my personal @gmail.com account, but I’m not receiving anything to my @domain.com G Suite account.

    Everything is verified on SendinBlue (both sender mail and domain), and I don’t understand why I can not receive anything to my G Suite.

    Is there any interference in using G Suite vs. Regular Gmail for SMTP?

    Thank you…

  6. Hi, I used this guide to set up my Contact me page. Thanks so much! Now I’m trying to set up another site but this time my e-mail is registered with NameCheap.

    Is there a guide you have for that? I have the SMTP Plugin setup to push the e-mails and the e-mail test said it sent successfully but I’m not seeing it in the WebMail inbox in NameCheap.

  7. Hi hi — thank you SO MUCH. Our nonprofit has been suffering with Sendgrid’s low (61%) user pool deliverability, and as a nonprofit, we have free GSuite, and I had NO IDEA we could do this (10,000 limit a day — way more than we need!). Everything connected awesomely thanks to your step-by-step instructions. I’m just thrilled.

    Is there any way at all to see a record of what emails were sent or any type of deliverability rate? I wasn’t sure if those were somehow stored in the app that was created during the set up? We love the feedback of knowing things are working and periodically check to make sure (which is how we found out our Sendgrid was so low).

    Thanks for any insight on this! And honestly, on behalf of all of our volunteer team, thank you, thank you, thank you. You’ve saved us a lot of time and funding that we were losing on Sendgrid.

    1. Hi G — Great, I’m glad this mailer option is such a good fit for your site! For email records, Gmail/G Suite does log sent emails in your regular inbox’s Sent folder. Or if you prefer to keep a log on your WordPress site, this feature is included with any of our paid licenses.

      However, as far as catching the details on delivery services like SendGrid and Mailgun (companies that are fully focusing on improving email delivery) are the best way to go. It does seem very odd to me that your SendGrid delivery rates would be so low, though I’m glad you were able to catch it and get an alternative going.

      I hope this helps! And if you have any other questions, please know we provide private email support for all paid license holders. Or if you’re using our free version, we provide limited complimentary support over in our WordPress.org support forum 🙂

  8. This was a great guide, so glad that you took the time out to create this for everyone!

    Just to add though, when sending the test email right at the end it seemed to keep failing.

    Not sure if this was mentioned already but I did some troubleshooting and realised GmailAPI wasn’t enabled for me.
    It’s worth adding a step to check that GmailAPI is enabled so the test email goes through successfully. I made this change and my test email was a success – worked like a charm!

    Cheers,
    Neil

    1. Hi Neil – Thanks for bringing this up! Most Google accounts would have the Gmail API enabled by default, but I agree we should mention this for those accounts where it’s disabled. We’ll make sure it gets into the next round of edits 🙂

  9. Thank you so much for posting this page. I have struggled with processes within Google developer console for a long time, particularly for maps. Finally, I have had a success.

    On many occasions I have been unable to send email to a Gsuite account from a WordPress site. It is a problem widely discussed in forums. It may be due to having/changing the admin password for forms to be a different one to the site but Im not sure. Anyway, your procedure has fixed the problem

    Many Thanks

    Richard

    1. Hi Massimo, thanks for letting us know!
      I will let my colleagues know so they can check and update the doc according to how it is currently looking like.

      Have a good one 🙂

  10. In trying to connect Gmail, I keep seeing this eror: “This app hasn’t been verified by Google yet.” When is this going to be fixed?

    1. Hi there!
      Please check in the WP Mail SMTP settings, that there is no a big orange button that asks you to allow plugin using your Gmail account to send emails. If you have that button, simply click it and provide access to the plugin to use your Gmail account.
      If this doesn’t work and you have a WP Mail SMTP or WPforms license, you have access to our email support, so please submit a support ticket.
      Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.
      I hope this helps.
      Have a good one 🙂

  11. Hi there,

    Thanks, it works well. But I noticed that it is working only when I send email from the same domain, as I have setup the contact form SMTP gmail with. If I fill the form with any other domain, the email is not coming through. What could be the problem? Any setting I need to change?

    1. Hi Arnab!
      Currently, Gmail API doesn’t allow us to use the different email address for the “From email” field other than your Gmail account email address.
      You can try to use another mailer option in WP Mail SMTP settings (i.e. Mailgun or Sendgrid) to have the ability to use another email address.
      I apologize for any inconvenience!
      Have a good one 🙂

  12. Hi, I set all of this up a few weeks ago per your instructions. At first it was working but now I am not receiving any emails that are sent through my website. When I do the “test email” under the SMTP settings I receive that email. However, when I go to my site and fill out the form and hit send, it says successful but the message is not delivered to my gmail account. I have checked the spam folder and they’re not going there either. Do you have any recommendations on how to fix this?

  13. Hello! Thanks for the tutorial! Can I know if is possible to show in email sent with this SMTP to show the gmail signature? Or have I to add the signature directly on WPForms settings?
    Thank You

    1. Hi Ricardo!
      SMTP is the way how the emails sent on your site, it doesn’t add anything to the actual email content.
      You can add anything to the Notification email under the form builder in WPForms (Settings > Notifications)
      I hope this helps.
      Have a good one 🙂

  14. then i send test email from wordpress to another gmail im getting spam or as phisingh email.

    How can i solve this?

    1. Hey there! Sorry to hear you are facing issues with Gmail SMTP. Most of the time, it is just a quick setting in the SMTP Plugin which needs to be adjusted for fixing such issues. I would suggest reaching out to WP Mail SMTP support if you have a paid license of WP Mail SMTP, or if you are a free user, you can reach out to them here. Have a good one 🙂

  15. Hello

    I’m using the WP forms plugin and it’s fantastic, thank you! But it’s sending out emails from my gmail address (I used gmail as I had issues setting up my SMTP) – is there any way to change this because I already have a webmail address I use for messages with my domain. I’d prefer to keep everything in one place if possible, so if customers reply to the automated emails it will come through to the email address I use for the site. I haven’t ticked ‘force email’ so I’m not sure why it’s overriding the default site email address

    1. Hey Luke, I am sorry for the delay in reply. I am afraid that Google doesn’t allow the From Email to be changed (it forces the From Email to be your Gmail email address). The easiest possible option here will be to add your other email address as Reply-To field in your form notification settings as shown here. This will ensure when someone replies to automated emails, the reply comes to your preferred email id. I hope this helps!

  16. Hi,

    I followed every step correctly but getting following error.

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v2.0.1 logged this error during the last time it tried to send an email:

    Mailer: Gmail
    {
    “error”: {
    “errors”: [
    {
    “domain”: “global”,
    “reason”: “required”,
    “message”: “Login Required”,
    “locationType”: “header”,
    “location”: “Authorization”
    }
    ],
    “code”: 401,
    “message”: “Login Required”
    }
    }
    Consider running an email test after fixing it.

    How can I fix this issue. ? Please help ?

  17. These are the best instructions I’ve come across. I’ve been to other sites where they expect you know what you’re doing and I have given up in the first three steps as what they say I should see, I don’t see and then don’t know what to do next! These are absolutely brilliant and for the first time, my contact page actually works! Thank you!

  18. Hi, i have a Multisite with 2 sites (eng/spanish), is working fine for one site but not for the other, in the second site i use the same Client ID an Secret key, is that correct? when going to “Allow plugin to…” i receive an error “Error 400: redirect_uri_mismatch”.

    Not very easy this stuff hehe

    1. Hey Jose – Sorry to hear you are facing trouble with that. If you are using the Gmail mailer, you will need to go to the same project and add the URL of both versions of the site. This should allow Google to recognize both sites. For further help, you may reach out to WP Mail SMTP support team.

      If you have a paid license of WP Mail SMTP, you can reach out to them here or if you are a free user, you can reach out to them here. Have a good one 🙂

  19. I am able to link the site with google API but I get this message when it sends the test email:

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v2.0.1 logged this error during the last time it tried to send an email:

    Mailer: Gmail
    cURL error 1: Protocol “https” not supported or disabled in libcurl [URL hidden]

    Consider running an email test after fixing it.
    I have the latest apt-get php lib curl installed and php 7.2
    My server is set up as http: with cloudflare proxy for https

  20. Nube successfully configures Google Cloud platform…. I can sleep well. The screens are all useful in this scenario, but had to rely on the step by step in GCP. And without your superb instructions, I have no doubt I would have had to call GCP support again!! Thank you for fantastic documentation. I have the same comments for WP forms as well. I subscribed to your channel and you are my go to support!!

    1. Hey Simon – Thanks for letting us know! Glad to hear that our documentation was helpful to you. Sure! Please feel welcome to reach out to support anytime you need help!

      Have a good one 🙂

  21. Wow, thank you so much for these steps! I was ready to abandon the whole idea of being able to receive emails from my website and then I found this blog post. Thank you 🙂

    1. Hey Odile – It’s great to hear that the tutorial helped you received email notifications from the website.

      Have a good one 🙂

  22. Hello,

    I followed the tutorial and keep getting this error
    ‘Error 400: invalid_request
    Invalid parameter value for redirect_uri: Raw IP addresses not allowed’ and am not sure what to do. Everything in the API i substituted the ip for the domain name but yet it still does this. What should I do?

    1. Hey there! Sorry to hear that you are having trouble. I would suggest contacting WP Mail SMTP support for this.

      If you have a paid license of WP Mail SMTP, you can reach out to them here or if you are a free user, you can reach out to them here. They should be able to help further on this!

  23. Hi, followed this to the letter 3 times, took ages, both gmail and other route to no joy. All looks setup and completed properly but it just will not send a test message. GmailApi also enabled. Actual WP site is on GCE. Nothing left to check… and i get no errors, just ”There was a problem while sending the test email..” Where please are the debugging error codes, everyone seems to get or is that in the paid part.

    1. Hi James – I would suggest contacting WP Mail SMTP support for more info on this.

      If you have a paid license of WP Mail SMTP, you can reach out to them here or if you are a free user, you can reach out to them here. Have a good one 🙂

  24. Ah. Found it at the bottom.

    Versions:
    WordPress: 5.4.2
    WordPress MS: No
    PHP: 7.4.7
    WP Mail SMTP: 2.1.1

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

    Server:
    OpenSSL: OpenSSL 1.1.1g 21 Apr 2020
    PHP.allow_url_fopen: Yes
    PHP.stream_socket_client(): Yes
    PHP.fsockopen(): Yes
    PHP.curl_version(): 7.52.1
    Apache.mod_security: No

  25. Not really used to post comments on blogs or anything (never did, actually), but this is the best how-to ever !!! Worked like a charm, never got lost in quite complex process.
    Thanks a thousand times!!!!!!!!

  26. Hi,
    I have very little experience with IT so my question might look silly to you, nevertheless I’m asking:
    Can I use the method described here to send emails via WP Forms plugin in WordPress, connecting it with Google if my domain and email services are at Bluehost?
    Situation:
    I have a site on Bluehost, my site email is on Bluehost. I can send and receive emails without problems via Bluehost. I have a SPF record in my DNS configuration: TXT Value: v=spf1 a mx include:[URL_Removed] ~all. All works fine when somebody just sends me an email and I respond.
    However, when a sender sends me a message via a form (WP Forms) on my site, indicating their Gmail email account, they receive a confirmation with a content of their message to this Gmail account. The message comes with a warning: Google could not verify that [URL_Removed] actually sent this message (and not a spammer).
    I’d like to avoid such a warning because it does not look professionally.
    I’d appreciate a comment if I can solve the issue with the method presented here (linking my site to Google’s smtp) even though my emails are at Bluehost. If not, maybe you could tell me what else I could do (keeping my emails at Bluehost).
    Best regards,
    Nick

    1. Hey Nick – The error message you mentioned will usually come when the FROM email address in your WPForms is not an email address on your hosting server.

      In that case, the receiving email server will see the FROM email address different from the server from which it is being sent, this will look spammy to them.

      The best solution here will be to have a FROM email address as an email address that is hosted on the same server. Also, yes, you can set up any SMTP mailer using the WP Mail SMTP plugin and that will take over email sending in WPForms.

      I hope this info helps!

      1. Thanks a lot Abhishek! My FROM email address is on my hosting server (Bluehost). I will try the second solution using the WP Mail SMTP. Best regards, Nick

      2. Hey Nick – In that case, using WP Mail SMTP should be the best option as that will authenticate your email address to ensure better email delivery.

        For any further help with WP Mail SMTP, you can reach out to them here or if you are a free user, you can reach out to them here.

        Have a good one 🙂

  27. Hi guys,
    Great plugin. I have it set up with Elementor Forms and all is working well except for one thing.
    When I receive an email from someone who has completed my form, it is sent from my domain rather than the email of the user. So i cannot click on ‘reply’ to answer the email. I have to click on theh email in the message part.

    Is there a way to make the email come from the user who completed the form rather than my domain?
    Thanks

    1. Hey Aidan – I totally understand your concern here! Most of the mailers in the SMTP plugin will force the FROM email address in the emails sent by them as that is the way for them to authenticate your emails. The good news is, we have Reply-To field available in WPForms notification settings.

      You can use this field and enter the smart tag for your email address field(more info on smart tags here) and then you can directly click on reply option of your email to respond to form submissions.

      For any further help on this, please drop us a line in support so we can assist.

      If you have a WPForms license, you have access to our email support, so please submit a support ticket. Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.

      Thanks 🙂

    1. Hey Solomon – In general, for sending bulk email, you should use separate email marketing tools but if you want to do via your site for some reason, I could find this good article for you.

      Have a good one 🙂

  28. Hi,

    Had no previous experience, but got it to work. Great tutorial!
    Still have a couple of questions.
    When setting up Oauth consent screen, Internal and External options are present. Only external option is available to Gmail users. Is this the correct one to choose, especially privacy-wise?
    Should any sensitive scopes be used?

    Thanks!

    1. Hey Peter – Great question! If you are using Gsuite email, it gives you the option to restrict many things accessible in your organization only, while using regular Gmail there is no such feature, that is why you see two options with Gsuite emails while only one for regular Gmail. There is no security issue involved as such, you are just authorizing that application to access your Gmail account so that it can send the emails via your Gmail account in an authenticated way to ensure better email delivery.

      I hope this info helps!

  29. I have created two WP sites and attempted setup on both! One went perfectly smoothly. However, when I setup the 2nd following the same process I get a “message”: “Mail service not enabled” message in the debug of the sending of a test email. I also noticed the ‘From Email’ says, please first authorize the Gmail mailer below. Yet, I’ve already selected the orange button for authorization. I’ve already setup an API project and verified I’ve put the right Client ID, Client Secret, and Authorized Redirect URI. I even uninstalled and deleted the WP Mail SMTP data! I don’t know what else to do!

    1. Hey Zach,

      I am sorry for the trouble you are facing here! You can follow this tutorial to go to the API section of the Google account and verify that Gmail API is enabled.

      Once the API is enabled and if you face any issue, please feel free to get in touch with the Support. If you have a WP Mail SMTP license, you have access to our email support, so please submit a support ticket.

      We also provide limited complimentary support in the WP Mail SMTP WordPress.org support forum.

      I hope this helps! Thanks 🙂

    1. Hey Melissa – I apologize, but I’m not sure I understand your question. Do you mean to send form notification to multiple email addresses? For that, you need to add a comma-separated list of email addresses in the notification settings of the contact form. Basically, to which address you want to send the form does not matter when you use an SMTP plugin. It is the FROM address which needs to be configured properly in case of SMTP plugins.

      For any further help on this, please drop us a line in support so we can assist. If you have a WPForms license, you have access to our email support, so please submit a support ticket. Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.

      Thanks 🙂

      1. Hello Abhishek
        Is it possible for your free or paid plugin to send using specific gmail alias to be sent from? in other word, the username that owns the mailbox is user@domainA.com, which is a gsuite account, and has an alias of user@domainB.com, can I send from domainB.com aliases, or is it just through the main address?

      2. Hey Jad – Great question! Yes, you can use Gmail aliases but that will be fixed in FROM settings of WP Mail SMTP. You can choose which alias you need for sending emails but you can’t use different aliases for different forms. Once it is selected in SMTP settings, it will be fixed for all forms.

        I hope this helps!

  30. All of these steps worked perfectly and I received a confirmation for the test email. BUT when I try to send an email from a contact form on my website, it is still not coming through.

    1. Hey Shawna – Sorry for the trouble you are facing. Our support team would be happy to assist further. If you are a paid license holder, please create a support ticket here. If you are a Lite user, we provide complimentaorty support here.

      Thanks 🙂

Add a Comment

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

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.