How to use Free Google SMTP Server

How to use Free Google SMTP Server

Not everyone knows that they can take advantage of free Google SMTP server to send emails. It can be the ultimate solution for those, who can’t use SMTP server provided by their ISP or hosting as well as those, who experience various email deliverability issues. In this tutorial, you will learn how to use free Google SMTP server. You will also find detailed instructions about how to use it in order to send emails via PHP mailer and WordPress plugin.

Benefits of Using External SMTP Service

Although, most hosting (for example Hostinger) and ISP offer SMTP support, there are quite a few benefits of using external SMTP service:

  • They can ensure better email deliverability.
  • You won’t have to setup your own server (if you use VPS).
  • Their servers are less likely to be blacklisted, which means, your email is less likely to be labelled as SPAM.

Free Google SMTP Sending Limits

Google limits outgoing emails to 100 per day. If the limit is reached, you won’t be able to send emails for the next 24 hours until it resets. More information about Google email limits can be found here.

Before you begin this guide, you’ll need the following:

  • Gmail or G Suite account
  • Access to your hosting control panel

Step 1 – Getting Google SMTP Server Settings

First of all, in order to use free SMTP server from Google, you need to allow access for less secure apps. Google started to block apps and devices that, according to them, do not use modern security standards. However, access for less secure apps can be easily turned on here.

Enable Access for Less Secure Apps

IMPORTANT: If you use 2 factor authentication to access your Google account, access for less secure apps cannot be enabled. In this case, you will have to sign in using App password.

You can find Google SMTP details below:

  • SMTP Server :
  • SMTP Username: Your full Gmail username (email address), for example
  • SMTP Password: Your Gmail password.
  • SMTP Port: 587
  • TLS/SSL: Required.

If you want to take advantage of IMAP protocol and store all outgoing emails in your Gmail Sent folder, follow these steps:

  1. Login to your Gmail account and access Settings section.
    Gmail Access Settings Section
  2. Jump to Forwarding and POP/IMAP tab and enable IMAP.
    Gmail Enable IMAP
  3. Press Save Changes button at the bottom of the page once you are done.

Step 2 – Using Google SMTP

In this step, you will learn how to use free SMTP from Google in order to send emails using PHP mailer and WordPress plugin. Knowing how to send emails via PHP is useful whenver you are learning to code or just want to build a simple contact form for your website.

Option 2.1 – Using PHPMailer

There are many PHP mail scripts available. In the example bellow, we will be using PHPMailer:

  1. Open PHPMailer repository on GitHub and download the script by pressing Clone or download -> Download ZIP button. Save it to your computer.
    Download PHPMailer Github
  2. Upload the archive to your hosting account. You can use FTP client or file manager provided by your hosting for this. If you’re not sure how to upload files to your hosting account, see this tutorial.

PHPMailer already has a sample configuration file named gmail.phps to use with Google SMTP servers. It’s located in PHPMailer-master/examples folder.

In order for this script to work with Google SMTP server, you will have to edit it and change settings like username, password and email recipient address. You also need to rename this file from gmail.phps to gmail.php so that it would be accessible via browser. You can use the same file manager or FTP client to rename and edit the file with your details.

Once you are done editing, simply open the script with your browser. If you have uploaded PHPMailer-master folder to public_html folder, the file should be accessible via If everything is configured correctly, you should see a success message indicating that the email message has been sent successfully.

Option 2.2 – Using WP Mail SMTP Plugin

The easiest way to use external SMTP on WordPress is to use WP Mail SMTP plugin.

Firstly access your WordPress admin dashboard and go to Plugins > Add New section. Install and activate WP Mail SMTP plugin.

Activate Plugin Button

Now access WP Mail SMTP settings page by going to Plugins -> Installed Plugins and clicking Settings.

Settings link

You will have to fill in all the required details of your SMTP server.

Settings page

  1. SMTP Host – Enter
  2. SMTP Port – Default Gmail SMTP server port is 465 for SSL and 587 for TSL.
  3. Encryption – It’s always recommended to use encryption. Choose it according to the port you have specified.
  4. Authentication – Select Yes as SMTP authentication is required.
  5. Username – your Gmail address.
  6. Password – your Gmail password.

To save the changes you have made click Save Changes button at the bottom. To make sure your settings are working correctly you can test it by sending a test email to your personal mail account. Enter your email address and click Send Test.

Test email

If you receive your sent email it means that mail sending is working correctly. However, if you get any error messages, double check email settings or contact hosting support team for assistance.


Upon finishing this tutorial, you have learned how to configure your Google account and use free Google SMTP server. You’ve also learned how to send emails via PHPMailer.

The Author


Domantas G. / @domantas

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

Related tutorials


Joven Reply

October 05, 2017

It has an error, says, "Message body empty"


Ben Johnson Reply

October 14, 2017

When trying to send an email with my google account, I get this error message— CANNOT SEND MAIL the connection to the outgoing server “” has failed. Additional outgoing mail servers can be configured for mail accounts in settings>



    Replied on November 30, 2017

    Have you done this: "Access for less secure apps can be easily turned on here."


Kadahsh Reply

February 26, 2018

The "SMTP Port Number" mentioned in Step I is wrong, it is '587', I followed the instructions literally and was getting Stack Trace error because of it, so i rechecked the settings changed the port number to 587 and then i was able to get the mails sent. Nice tutorial though Thanks!


    Domantas G.

    Replied on February 27, 2018

    Hey Kadahsh, Thanks for pointing this out. Tutorial has been updated with a correct port number!


kavya Reply

June 10, 2019

Worked like charm! Thanks a lot for the detailed steps.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a part of Hostinger now!

More in Email
How to add an Email Account to Mac Mail
How to add an Email Account to Mac Mail