Solved: How-To Use Gmail SMTP to Send FROM an Email Address which uses Cloudflare Email Routing

Send emails using Gmail SMTP from an email address which is routed through Cloudflare. You CAN Use your Gmail account as an outbound mail server

which links to…


STEP 1. Make sure you have 2FA enabled

For this method to work, you need to have two factor authentification enabled for your Google account. If it’s not, follow the link below and set it up → Enable 2FA in your Google account

STEP 2. Also in your Google account, create an App Password for MailCreate an App Password… (You will copy and use this password later along with your Gmail address in the Google SMTP server settings “Add another email address” form)…

Select “Mail” for the app. Select your computer as the device. Hit “Generate”. Copy and keep the generated password for later in this process.
STEP 3. Then, back in Gmail, add your Cloudflare-routed email address

In Gmail go to Settings → Accounts → Send mail as. Under that section, click on Add another email address and fill in the first form with your name and your Cloudflare-routed email address. Untick “Treat as an alias” and click Next Step >>

STEP 4. Fill in the next form

SMTP Server: Port: 587
Username: your gmail address (incl.
Password is the App Password you generated in Step 2.
Leave TLS enabled
Click Add Account >>

You will receive an email from Gmail asking you to confirm ownership with a code. Enter the code in the dialog (or click the link provided in the confirmation email), and you are all set!

Now you can select your new email address in the list when you compose a new message in Gmail. And, when reply to an email you received at your new address, the new address should be pre-filled in the From: field.


If you’re going to be sending e-mail from Google’s SMTP servers, you’d likely want to update your SPF TXT-record to incorporate as well. For example:

v=spf1 ~all

Yes, thank you @jwds1978 for clarifying this!

The DNS records for your domain on Cloudflare (the one for which you have set up the Email Routing) – that domain – should have a TXT record with the SPF policy. It looks like this (where in this example I have Email Routing set up for my domain on Cloudflare,

In order to authorize the Gmail SMTP Servers, so that you can send emails from your Gmail email account using your Cloudflare-routed email addresses, you need to replace the the Content in this DNS TXT record entry with…

v=spf1 ~all

Then click the Save button.