Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Send Email in WordPress using the Gmail SMTP Server

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Send Email in WordPress using the Gmail SMTP Server

Recently we had an issue with one of our clients’ Gravity Form on their website. The data wasn’t being passed on to their Google Apps account email because WordPress doesn’t use SMTP mail like Google. Rather, the wp_mail() function makes use of the standard PHP mail() function which was trying to send to the address located on our client’s server. Now this is not entirely WordPress’ fault because on our servers it worked fine. So this also had to do with how their emails were setup on that specific server. Long story short, in order to resolve this issue we installed a simple plugin that would reconfigure the wp_mail() function to use SMTP mail. This made it possible to send all incoming data from the Gravity Forms directly to their Google Apps account. In this article we are going to show you how to install WP Mail SMTP Plugin for WordPress so you can send email using the Gmail SMTP server.

Note: for those running on shared hosting like Bluehost, Host Gator etc, make sure you check out MarcusWickes comment.

Firs thing you need to do is install and activate the plugin WP Mail SMTP. Upon activation the plugin adds new option under your Settings tab: Settings &raquo Email.

WP SMTP Mail Screenshot

If you click on that, it will bring you to a screen that allows you to configure all of your mail settings. At the top you will have a place to input which email you would like to use as a sender. If you leave that blank, then the default site email will be used. The name field can have your name or your site’s name. This will be shown as the person who is sending it. Make sure you select send all emails via SMTP.

The SMTP host and port are already predefined in the image for Gmail. For your convenient, here they are below:

Port: 465

You can set which type of Encryption you want. This may vary depending on your server settings.

Click save and you are good to go. Before you do anything else, there is the option at the bottom of the screen to send a test email. You should do this to make sure that everything is working properly.

Download WP Mail SMTP Plugin.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. zohaib Sultan says:

    This is really helpful for me. I solve a big problem by visiting your post.Thanks great job.

  2. Sherwin Ramnarine says:

    Here’s how I got this WP Mail SMTP plugin to work…I’m using Bluehost web host, Zoho Mail for my email and Contact Form 7.

    After reading Marcus’ comment, I created a new email account (, first in Zoho Mail and then in Bluehost, with the same password.

    The successful SMTP host I used was Bluehost’s ‘’. The username was the and that password.

    Got the idea from here >>

  3. white-noise-machine says:

    I get this SMTP connect() failed.

  4. James says:

    I discovered a little change I would make to what was said by Marcus… I tried it with what he said, but it didn’t work for me using Bluehost… What I then tried, was using all the same things said above, and with the changes Marcus suggested, then in the settings for the wordpress plugin, I told it to use the account on the bluehost server with it’s server info and login info and it sent the email out with the right return path and when i reply’d to it, it went back to the gmail email account…

    Thanks for the start on getting this to work!

  5. WPBeginner Staff says:

    Please checkout our guide on how to fix WordPress not sending emails issue.

  6. WPBeginner Staff says:

    Yes, you may also want to take a look at how to fix WordPress not sending emails issue.

  7. aaina says:

    is this compatible with wordpress 4.0 and contact form 7

  8. WPBeginner Staff says:

    Please take a look at our guide how to fix WordPress not sending email issue.

  9. Bob says:

    Found out this does not work if WP wants to send 15+ mails at once. ( imagine changing 20 order statusses in a woocommerce installation )
    Looks like Google just blocks that.
    I am now searching for a mail service that does send more at once.

  10. DavidSiqueiros says:

    I am trying to get email sent from Domatic server where the website resides. The company does it’s email from a different server maintained by a separate group. So the website on one server with company email sent from another server. My problem is that the forms within my WP theme are not sending the emails although it does look like they are. I installed WP-SMTP-MAIL-CONFIG and followed the instructions including reding Marcus’s post. I keep getting a 110 timeout error.

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 comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.