Skip to content
Start here

Gmail Send mail as with Cloudflare Email Routing

Reply as you@yourdomain from Gmail while Cloudflare forwards your mail: which SMTP server to use, a fix for each error, and why replies show via or fail DMARC.

On this page · 7 sections

Why replies leave from your Gmail address

Email Routing only brings mail in. Cloudflare says it does not support sending or replying from your domain, so when you answer a forwarded message, the reply goes out from the destination address, such as my-name@gmail.com, not info@yourdomain.com. [1]

Gmail's Send mail as fixes that by sending through an outgoing (SMTP) server you name: you add the address, Gmail asks for the server, port, username and password, then mails a confirmation link to the address. [6] With Email Routing, that confirmation is forwarded to your Gmail like any other message.

Which SMTP server to use

Email Routing has no outgoing server of its own, so Send mail as needs one from somewhere else. Two are common for Cloudflare domains:

Server and port
Gmail's own server: smtp.gmail.com, port 587 with TLS or 465 with SSL [6]
Cloudflare Email Sending: smtp.mx.cloudflare.net, port 465 with SSL only; 587 is not supported [2]
Username
Gmail's own server: Your Gmail address
Cloudflare Email Sending: The words api_token, exactly [2]
Password
Gmail's own server: An app password, which needs 2-Step Verification [7]
Cloudflare Email Sending: A Cloudflare API token with Email Sending: Edit [2]
Before it works
Gmail's own server: Turn on 2-Step Verification, then create the app password [7]
Cloudflare Email Sending: Onboard the domain under Email Service > Email Sending; to write to anyone, the Workers Paid plan [2] [5]
Signed as your domain?
Gmail's own server: Check a sent reply, as shown below
Cloudflare Email Sending: Yes: Cloudflare signs every message with DKIM for your domain [2] [4]
Cost
Gmail's own server: Free
Cloudflare Email Sending: Workers Paid: 3,000 emails a month included, then $0.35 per 1,000 [5]

Cloudflare's SMTP sign-in has been in beta since June 8, 2026, and Cloudflare presents it as a way to send transactional email, such as alerts and order confirmations, from apps that already speak SMTP. [3] Treat the API token like a password: anyone holding it can send from every domain onboarded on that account. [2] The same server works in a desktop mail app: Cloudflare SMTP in Apple Mail and Thunderbird.

Set it up

  1. Make sure the address already arrives: an Email Routing rule for you@yourdomain.com (or the catch-all) must forward to this Gmail account, or the confirmation email never reaches you.
  2. In Gmail on a computer, open Settings > See all settings > Accounts and import, and under Send mail as choose Add another email address. [6]
  3. Enter your name and you@yourdomain.com, then fill in the server, port, username and password from the table above. [6]
  4. Open the confirmation email Gmail sends to that address and click its link. If it hasn't come, look in Spam for mail from send-as-noreply@google.com. [6]
  5. When you write or reply, click the From line and pick your address. [6]

Errors and what fixes them

Couldn't reach server, or TLS Negotiation failed
The port and security don't match. Google suggests trying SSL on 465 or TLS on 587. [6] For Cloudflare, only SSL on 465 works. [2]
Gmail's server refuses your password
Use an app password, not your Google password. If the app password option is missing, your account uses security keys only, is a work or school account, or has Advanced Protection. [7]
535 5.7.8 Authentication failed (Cloudflare)
The username must be api_token, with the token as the password. The token needs Email Sending: Edit and must not be revoked or expired. [2]
550 5.7.1 Sender denied (Cloudflare)
The domain isn't onboarded for Email Sending in the account that owns the token. [2]
550 5.7.1 for the person you wrote to (Cloudflare)
On the Workers Free plan, Cloudflare sends only to verified destination addresses. Upgrade to Workers Paid to write to anyone. [2]
The confirmation email never arrives
Check Spam for send-as-noreply@google.com [6], then the Email Routing Activity log. See Email Routing not working.
People's replies come back to your Gmail address
By default, replies go to your Gmail address. In Accounts, click Edit info next to your address and specify a different reply-to address. [6] Several people sharing one address? See Reply from a shared team@ address.

"via", "on behalf of" and DMARC failures

Even when the reply sends, the person you wrote to may see that it came from somewhere else. Outlook and other services can show "yourname@gmail.com on behalf of" your address. [6] Gmail adds "via" when the domain that sent the message isn't the domain in the From address. [8]

Google's fix is the same for both: an SPF record that includes the server that sends for you, a DKIM signature for your domain, and a From domain that matches the domain the mail is authenticated with. [8] DMARC checks exactly that: a message passes if SPF or DKIM passes and its domain lines up with the From domain. If neither lines up, it fails, and a p=quarantine policy sends it to spam while p=reject turns it away. [9]

To see which one you have, send a reply to another account of yours and open it with More > Show original. [10] A reply through Gmail's own server can look like this example, where both checks pass for gmail.com and DMARC fails for your domain:

Example: a reply that fails DMARC
spf=pass smtp.mailfrom=you@gmail.com
dkim=pass header.i=@gmail.com
dmarc=fail header.from=yourdomain.com
  • A Google SPF include isn't always enough. Many guides add include:_spf.google.com to SPF, but SPF lines up only when the envelope sender (the smtp.mailfrom or Return-Path) is on your domain. [9] If Show original shows a gmail.com address there, the include doesn't help DMARC.
  • Turning on Email Sending can add a reject policy. When you onboard a domain that has no DMARC record, Cloudflare adds v=DMARC1; p=reject;. Cloudflare says to set it to p=none while another service still sends for the domain, until that mail lines up. [4] If replies through Gmail's server started bouncing after you onboarded, look here first.
  • Cloudflare's server lines up on its own. Its DKIM key sits at cf-bounce._domainkey.yourdomain.com, so the signature is for your own domain. [4] A domain can have only one SPF record; to merge one, see SPF, DKIM and DMARC on Cloudflare.

Reply without Gmail in the middle

Send mail as keeps two services stitched together until January 2027. Ayoh puts both halves in your own Cloudflare account instead: Email Routing receives, Email Sending replies, and Ayoh publishes the SPF and DKIM records, so mail goes out signed as your domain from one inbox. Nothing to Ayoh; Cloudflare's Workers Paid plan is $5 a month. Setup is in Getting started, and the other ways to reply are in Cloudflare Email Routing: send from your domain.

Sources

Read November 25, 2026.