For web developers, setting up reliable email sending from a website might be a hassle.
Although the web hosting company’s server email may be suitable for simple sites, it is recommended to use an SMTP email account for any website that requires dependable email delivery.
In the past, I have utilized Gmail’s free SMTP services, but with recent security changes. I found myself having to reconfigure these settings. Well, the process is painful.
I used to have to guide my clients through the arduous process of authorizing their Gmail email accounts with the website’s SMTP plugin before I learned this approach. I can’t perform anything for them since you have to be logged in to accomplish it.
In this article, I’ll demonstrate how to set up a secure Gmail account on your website so that it can send emails reliably with minimal hassle.
The Harder (But More Secure) Way
Creating and configuring an app in your Google account, then providing the resulting Client ID and Client Secret code in your SMTP plugin, is the most secure way to set up your site to utilize Gmail to send emails. A Google Workspace account may be required for this account.
See directions to set up your WP Mail SMTP account with your Gmail account. There are MANY steps involved!
Do it in this manner if you have access to the aforementioned Google account.
You can’t do anything for the client if they have two-factor enabled and don’t want you accessing their Google account. Many of my non-technical clients are unable to complete these steps on their own.
The Easier Way
Making use of the Gmail SMTP server, creating an app password, and entering it into your SMTP plugin are easier ways to get a Gmail account to function with your website.
There is a limit of 500 messages that can only be sent using this method per day. But for smaller clients, this is a great solution.
Here’s how to use Google to acquire your app password. Keep in mind that for this to function, two-factor authentication must be activated on the account.
Once you have it, use that password and the following settings to configure your SMTP email plugin:
- SMTP server: smtp.office365.com
- Port Number: 587
- Encryption method: TLS
Generating Gmail App Password
Here are the steps to generate a Google Mail app password:
- Go to https://myaccount.google.com/
- Go to Security
- In the “Signing in to Google” section, click “App passwords” (you will need to verify your password)If you don’t see this option, it might be because:
- 2-Step Verification needs to be set up for your account.
- 2-Step Verification is only set up for security keys.
- Your account is through work, school, or any other organization.
- You turned on Advanced Protection.
More info on this on Google’s page on signing in with app passwords.
Check these possibilities then return to the steps below when you see “App passwords” and can click it.
- When you see the popup, in the “Select App” pulldown menu, choose “Mail”.
- In the “Select device” pulldown, choose “Other (custom name)”
- Type in the name of your website followed by “-email”. For example: “mywebsite.com-email”, or anything descriptive and easy to remember so you’ll know what this password is for and won’t accidentally delete it later.
- Click Generate and copy the password that appears.
That last step is crucial. Remember to copy and paste that password somewhere safe because you won’t ever be able to view it again in your Google admin.
That was pretty much the hardest part. Now, just give that password to your developer and they should know what to do afterward.
I often refer my clients to this article when setting up their SMTP settings. Hopefully this will help you as well.
Ethan is a Full Stack Web Developer and SEO Specialist based in Pittsburgh, PA. In his free time, Ethan enjoys working on various projects involving Ruby, Vue and AWS applications.
Ethan graduated from The Firehose Project coding bootcamp in 2016 with a focus on Ruby on Rail and Computer Software engineering.