D5 Creation Blog

Gmail SMTP from WordPress

How to Send Email in WordPress using the Gmail SMTP Server

Emails are still the best and the most reliable way to communicate without hassle. When working with a WordPress website we get default functionality to use emails that feature gets enabled via PHP function but it is widely regarded as unreliable and ineffective. In this article we shall discuss about setting Gmail SMTP from WordPress so that you can Send Email in WordPress easily.

Gmail is a giant in email services with over 1.5 billion users globally, Gmail provides a simple method to send and receive emails.

While working with WordPress website we get default PHP method to send emails but there are some downsides to the method:

  • Most of the WordPress hosting companies restrict the usage of this PHP mailing function to prevent the misuse and spam done from numerous website owners.
  • The spam filter of most of the popular email service providers are pre equipped with features to detect a spam mail and most of the mails send via PHP default feature fails to bypass the filter and lands up into the spam folder, hence the end user is not able to recognize it most of the time
  • Another aspect where the default email provider lacks is the provision of security and ability to look credible, mails from PHP function will mostly look non-authentic.

Just rewind the time you received a mail, which compelled you to click on the mail and open that.

If the source of the mail is authentic and trustworthy then automatically, we as users tend to click on that without any kind of reluctance.

These were the reasons that led to the popularity of the service that provides us access to use our Gmail based email to send emails when working with a WordPress website.

This tool we are going to unveil is a SMTP based WordPress email service that easily authenticates a user's Gmail account to send email via the Gmail SMTP server.

SMTP is acronym for simple mail transfer protocol is a set of rules that takes responsibility for transfer of mails securely, began in 1984 ever since then SMTP is heavily used in sending and receiving mails.

To use SMTP Gmail server in WordPress to send mails we have a dedicated WordPress plugin.

Just like every other feature that we want to integrate inside a WordPress site not available originally, we have WP plugin named “WP Mail SMTP”.

More than over 1 million websites owners choose to use WP Mail SMTP to send their emails effectively.

When using SMTP based plugin emails are sent using the provider’s direct API for eg. Gmail’s API. This means even if the web host of WordPress website is blocking SMTP ports, your emails still gets delivered to the end user successfully.

How do I start using this feature?

Well, all you need is to devote few minutes in reading the blog and acting just as told in this step by step tutorial.

Now is the right time to discuss further actions you need to do to use this plugin and send mails with Gmail servers.

Setting Up Gmail SMTP from WordPress

  • First step is to get any plugin is to log into the WP dashboard of your website and go to plugin section and click on “Add new
  • Now in the search bar type “WP mail SMTP by WPForms”, Install the most relevant plugin that comes first in the search result then activate it.
  • There various other plugins available as well by several developers for same purpose but here we choose “WP Mail SMTP by WPForms”.
Gmail SMTP from WordPress

Configuring WP mail SMTP Plugin

  • First activate the installed plugin
  • Now, upon activation all you need is to visit Settings >> WP Mail SMTP page to configure the plugin settings
  • Now just visit the ‘From E-mail’ address bar and type in your G-Mail email address.
  • Next task in the queue is that you need to provide the sender’s name, here just type in your own full name or the name you wish to showcase.
  • Now select Mailer as ‘Gmail’ as you are using Gmail.
  • Check the box as set the return path to be the same as the sender.
  • Now you will see the option to enter your Client ID, Client Secret, and URL in the ‘Authorized redirect URI’ input field ,To enter these field first you need to set it up by visiting Google Developers Console.

Generating API Keys for Gmail

Gmail SMTP for WP
  • Just give that new project of creating APIs a recognizable name.
  • The project will now be created and you will see the project on the dashboard
  • Google offers numerous APIs for several services, here you need to search for the Gmail API.
  • Just type in Gmail in the search bar and simply enable the options to activate it.
  • Now next step is to create your custom credential for this API to be used in SMTP plugin
  • Click on the “Create Credentials” section.
Gmail SMTP for WordPress
  • It will ask you which API you are using then select Gmail API in dropbox.
  • Once it's done it will ask you ‘Where you’ll be calling the API from’ field, select ‘Web browser JavaScript’
  • Next option will be to select ‘What data you will be accessing’, select ‘User Data’ option.
SMTP WordPress
  • Afterwards just click on the ‘What credentials do I need’
  • Now then next thing will be that the system will ask you to decide a name for your OAuth client name. You can enter ‘WP Mail SMTP’ here for the sake of convenience.
  • At the JavaScript origin field just type in the URL of your website from where the origin of the content is i.e. your website address.
  • Next field is about pasting the Authorized URL for redirection purpose which you will easily get inside the Plugin’s setting option, here you need to copy and paste the authorized redirect URL from WP Mail SMTP plugin settings.
  • After that, click on the ‘Create client ID’ button to continue.
  • After this process, you need to enter a name for the OAuth consent screen. You can put the plugin’s name here i.e. WP Mail SMTP and just hit and smash the done
  • You are almost done, only a small amount of work is still pending, so let's do that as well.
  • After hitting done, you will be taken to the project credential dashboard, where you have the option to download the credentials for further use in JSON format or you also have the option to edit them.
  • Now move to WP Mail SMTP settings page, Now enter the client ID and secret key that you got from the credentials section.
SMTP for WordPress
  • After That task now just click on the ‘Allow plugin to send emails using your Google account’ Now you will be taken to a google interface asking you to allow the website to send emails in your place, just hit allow.
  • Now notification will come up that will tell you that you have successfully linked your wp site to google API project.
  • Now you are good to go and send emails via Gmail SMTP server.
  • Sending Test mails

You can send a test email to test if the feature is working fine or not, just go to settings and hit WP mail SMTP and smash the ‘Email Test’ button and send a test email simply.

That's the end of this long step by step journey, wasn’t that simple?

WP Main SMTP
Send Email in WordPressSend Email in WordPress

That’s all, you have efficiently and perfectly set up your WordPress site to send emails using Gmail SMTP servers.

There are other methods to execute this task as well but this is the easiest path.

Ways to leverage this feature

Most of us are feeded that social media and its communication tools like direct messaging has overshadowed all other mediums but one medium that continues to shine and give results to marketers, business owners and digital consumers is E-mail.

Newsletter is on the rise, to start off the journey in digital ecosystem one has to create a community that trusts him/her for the niche he or she is working in Newsletters helps us to build credibility.

But mails send from non-credible sources will land up in spam.

Once you start using your Gmail account to send emails to your audience will start to open and read your mail.

This is the best way to leverage this plugin’s feature, by sending regular mails to your community members or subscribers.




Author : Ravi Kumar

Ravi Kumar is a SEO specialist working remotely with a number of brands around the world. He loves diagnosing digital marketing issues on websites, and helping to implement solutions to improve site indexing. He loves writing on topics like web hosting companies, VPN, digital marketing, computer programming languages and like so.

Comments are Closed