DEV Community

Cover image for How to Send Email with Vercel Domain through GSuite
drew.tech
drew.tech

Posted on • Edited on • Originally published at drew.tech

How to Send Email with Vercel Domain through GSuite

Sending email with Vercel Domains

In order to send emails with a custom domain, we need to:

  1. Buy the domain
  2. Purchase email hosting
  3. Configure DNS records on the domain

We will focus on steps two and three in this post. This post assumes you are using a domain purchased through Vercel and have now CLI access configured.

You might be asking yourself:

Why can't we just use Vercel (or other domain provider) for emails? Do I really need to pay more money?

The answer is yes, you do need to buy hosting. Namecheap actually has a pretty good description of why you need email hosting. Think of it as the same thing as website hosting, except for your emails.

Enter GSuite

GSuite is an alright product for sending emails from custom domains. To be clear, this tool is geared at enterprise businesses, so the UX leaves something to be desired.

Step One

Sign up for GSuite πŸ’°πŸ’Έ

Step Two

Confirm you own the domain.

In GSuite admin, go to Manage Domains. Click Add A Domain or Domain Alias.

To verify you own the domain, you will need to set a TXT record on your domain's DNS settings.

With Vercel's now, it looks like the following:

List out your domains

now dns ls

Enter fullscreen mode Exit fullscreen mode

Using Google's verification code, run the following command

now dns add YOURDOMAINHERE.com @ TXT YOURGOOGLEVERIFICATIONSTRINGHERE
Enter fullscreen mode Exit fullscreen mode

Press Validate in GSuite and Google will try to confirm you own the domain. It may take some time before this works, be patient.

Step Three

Setup MX records.

After you prove you own the domain, it's time to start forwarding emails to Google.

This is also done via DNS records on your domain. Run each of these in your CLI.

now dns add YOURDOMAINHERE.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add YOURDOMAINHERE.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add YOURDOMAINHERE.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add YOURDOMAINHERE.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add YOURDOMAINHERE.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
Enter fullscreen mode Exit fullscreen mode

Verify the MX records with GSuite.

Step Four

Configure Gmail and GSuite.

Now, head over to Gmail.

Click on the settings gear, Accounts, and then "Add another email address".

Enter in your new email and select "Treat as an alias".

You may see the error:

Functionality not enabled.
You must send emails through YOURDOMAINHERE.com SMTP servers when you send as you@YOURDOMAINHERE.com. However, this functionality is not available for your account. Please contact your domain administrator for more information.

To fix this error, hop over to the Gmail settings in GSuite for End User Access and enable "Allow per-user outbound gateways".
gmail setting in GSuite

Wait a few minutes and add the email address again in Gmail to resolve this issue.

Happy Emailing

If you want to test out your new email, send me an email from your new account at drew@developerspin.com.

Top comments (6)

Collapse
 
sonnk profile image
Nguyen Kim Son

Actually the step 2. can be free :). The reason email hosting is expensive is because the provider needs to allocate some ressources to store/index the emails. If let’s say, you have plenty of storage left in your current email, an email alias solution is enough.

In SimpleLogin roadmap we want to support custom email domain soon so basically one can have infinite custom domain email addresses 😎.

Collapse
 
dbredvick profile image
drew.tech

Let me know when you have this available! I would love to try it.

Collapse
 
sonnk profile image
Nguyen Kim Son

Great, will definitely let you know when the feature is in beta (it’s already work in progress). How do I send you a message? Via twitter dm?

Collapse
 
mijim profile image
Medusa

Thank you so much! You saved me a lot of time 😁

Collapse
 
aralroca profile image
Aral Roca

I have done everything but it still does not work. Is it likely to take some time to be applied?

Collapse
 
glencodes profile image
Glen Burnett

Hooray, you just saved me, thanks for this. I love the internet when this happens. You find something someone wrote, and it helps you :)