How to connect your Gmail account to SMTP Express
Turn your gmail account into a transactional powerhouse.
Some months ago, I created a guide on sending emails from React with SMTP Express. The article features all the use cases you will need when building a feature that requires transactional emails.
Since then, there have been a lot of updates on SMTP Express, including a new and improved email domain management. Not only can you connect your custom domains, you can also bring your own SMTP server and send emails directly to recipients.
In this guide, I’m going to be showing you how to connect your gmail account to SMTP Express.
How does this work?
This is done by remotely connecting to your SMTP Host address from within your project domain settings.
To reach your domains, Navigate to Project > Domains
As you can see from the image, I have already connected my gmail account, but I will walk you through how to set up yours.
Start by clicking on the three dots beside the connect domain button and select connect server. You will be presented with a form that requires you to input your domain name and SMTP credentials.
In our case, this domain is gmail.com
and the hostname is smtp.gmail.com
. Next, you will need to provide a port number, username, and password.
SMTP Server Credentials
In general, this is the domain that ends the email address you intend to send from. In our case, we’ll be sending from <username>@gmail.com
which is why we’re setting the domain to gmail.com.
Bringing in a custom SMTP Server means it has an host address. For Gmail, it is smtp.gmail.com
. If you’re using a different provider, ensure you confirm the hostname of the SMTP server.
Ports 587 or 465
are standard ports that most SMTP servers expose. For Gmail, it is 587. For other providers, a different port are sometimes used. Be sure to confirm with your provider.
Username and passwords are usually issued to you as a user of an SMTP server. For Gmail, your username is your email address.
How do I get my password?
You will have to generate your app password from your Gmail account. This password will enable a remote connection with your Gmail account. To do that, follow this link to your app password generator.
Enter a name and press create. You will be presented with a modal containing a 16-character string code for your password. Copy it and head back to your project dashboard. Paste it into the password field and Connect to this SMTP server.
Testing our new setup
Now that you have connected a server, let’s head over to quickly send a message and test out our new setup.
Select gmail.com
from the domains dropdown and enter the other half of your email address (the username). Fill out the rest of the information needed to send a new email. If everything goes fine, your email should be in your inbox with the sender being your gmail email address.
This is one of the many capabilities SMTP Express helps you unlock and We are rapidly adding a host of other features to improve the state of sending transactional emails. Exciting times ahead!
Sound interesting? You are Welcome to Join us!