Gmail integration with website e-mail

Gmail integration with website e-mail

E-mails stored on website hosting server take up space and the limited number of files (iNodes). Here I’ll explain:

  • How to set up so that e-mails are stored on Gmail account (of choice, or a specially created one for the website alone), not on the hosting server.
  • How to, from a Gmail account, send e-mails using [email protected], instead [email protected]
  • How to receive mails sent to [email protected] from a Gmail account.

Contents:

  1. Introduction
  2. Setting up sending with SMTP from Gmail
  3. Setup receiving POP3 email to Gmail
  4. Testing


1. Introduction

Since e-mails are important for business correspondence, I prefer having them stored “in the cloud”. Also, such setup makes website migration easier and faster.

Integration with e-mail clients other than Gmail (like Mozilla Thunderbird for example) is done using a similar principle. Also, mail clients can be set up to leave e-mail copies on the server, either permanently, or for a limited time (30 days, or so).

For understanding instructions given here, it is required to understand and gather the needed information as explained in the post: E-mail setup in cPanel and DNS. Picture 1 below gives a brief reminder:

In addition to the username and password, you should also write down: Incoming server name and ports (1) Outgoing server name and ports (2) Picture 4
In addition to the username and password, you should also write down:
Incoming server name and ports (1)
Outgoing server name and ports (2)
Picture 1


Take the time, do as explained in the noted article, write down the needed information, then continue reading here.

It is also understood you have a Gmail account, of course.


2. Setting up sending with SMTP from Gmail

First we will set up e-mail sending, using SMTP. Open Gmail account, then click on the small sprocket (“Settings”).

Gmail account settings Picture 2
Gmail account settings
Picture 2


Then click on “Accounts and Import” -> “Add another email address”.

Add the website SMTP account Picture 3
Add the website SMTP account Picture 3


After clicking the option (2) in picture 3, you’ll get a pop-up window to setup the account.

Enter the name you want displayed (1) Enter the e-mail address you'll be using (2) Check "Treat as an alias" (3) Click "Next Step" (4) Picture 4
Enter the name you want displayed to mail recipients (1)
Enter the e-mail address you’ll be using (2)
Check “Treat as an alias” (3)
Click “Next Step” (4)
Picture 4


After clicking on “Next Step”, you get the following screen:

Enter the information of your SMTP account (server name, username, password) (1, 2, 3) Choose option as shown in the picture (4) Choose port your SMTP server uses (5) Then click "Add Account" (6) Picture 5
Enter the information of your SMTP account (server name, username, password) (1, 2, 3)
Choose option as shown in the picture (4)
Choose port your SMTP server uses (5)
Then click “Add Account” (6)
Picture 5


Don’t let the point (4) in the picture above confuse you – that is the safer option and TLS encryption will be used (if certificate and the hosting server allow it, as they should).

Now you should receive an e-mail with a control code that should be entered as shown in picture 7. E-mail can be checked from cPanel’s webmail.

Confirmation code sent to the e-mail account Picture 6
Confirmation code sent to the e-mail account
Picture 6


The verification code should be copied to Google’s window:

Copy/paste the verification code (1) and click "Verify" (2) Picture 7
Copy/paste the verification code (1) and click “Verify” (2)
Picture 7


Now you can choose the default sending address for the Gmail account:

You can choose the website's e-mail as the default sending account (1) Clicking (1) will change default address shown next to (2) Picture 8
You can choose the website’s e-mail as the default sending account (1)
Clicking (1) will change default address shown next to (2)
Picture 8


This concludes the Gmail setup for sending e-mail using website’s SMTP. Testing is explained in chapter 4.


3. Setup receiving POP3 email to Gmail

How to setup e-mails sent to the website’s address to be received to Gmail, and deleted off the hosting server so they don’t fill up the inbox there.

Go to Gmail account settings, as shown in picture 2. Only this time choose “Add a mail account”.

Choose the marked option to add your website's mail account Picture 9
Choose the marked option to add your website’s mail account
Picture 9


After this, you’ll get a pop-up screen to enter the e-mail address:

Enter your website's e-mail address Picture 10
Enter your website’s e-mail address
Picture 10
Choose the options as shown in the picture and click "Next >>" Picture 11
Choose the options as shown in the picture and click “Next >>”
Picture 11


Now you will need the info shown in picture 1 and explained in chapter 1 (you might want to re-read it if picture 12 is not clear enough). In this case, POP3 port for TLS connection is 995, so we’ll use that:

Enter the info based on your SMTP account setup (1, 2, 3, 4) Choose other options as shown in the picture (5) Click "Add Account" (6) Picture 12
Enter the info based on your SMTP account setup (1, 2, 3, 4)
Choose other options as shown in the picture (5)
Click “Add Account” (6)
Picture 12


You could also choose to not delete the retrieved e-mails off the server (“Leave a copy of retrieved message on the server”). Note that in time the left emails will pile up, taking a lot of storage space and making website migration and website backup creation more difficult.

And that’s it. Now it’s time to test whether it all works properly.


4. Testing

The quickest way to test both sending and receiving is to send an e-mail from your address, to your address. But also try sending to at least one Gmail and one “non-Gmail” address – just in case. See if those e-mails arrive properly. Also, send an e-mail to your address from one Gmail and one “non-Gmail” address to confirm you can receive them.

After this, if it’s all OK, the last check is done using a mail testing tool. Go to mail-tester.com. Then follow the instructions I wrote in the article about SMTP mail sending with WordPress, just send the mails using the Gmail account, not WordPress.

Testing is very important, don’t skip this part – if anything is malfunctioning with your website e-mail delivery, you should be the first one to know.

Share...

Leave a Comment

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