# 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.

Source: https://ayoh.dev/help/cloudflare-email-routing-gmail-send-as (updated November 27, 2026). Part of the Ayoh user guide: https://ayoh.dev/llms.txt

## 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.

> Google's page says that starting **January 2027**, Gmail will no longer support Send as for third-party email addresses; Google Workspace aliases and other Gmail addresses you own are not affected. [6] An address on your own domain is neither, so plan for this setup to stop then. What ends, and what still works: [Gmail Send mail as is ending](https://ayoh.dev/help/gmail-send-as-ending).

## 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:

| Setting | Gmail's own server | Cloudflare Email Sending |
| --- | --- | --- |
| Server and port | `smtp.gmail.com`, port 587 with TLS or 465 with SSL [6] | `smtp.mx.cloudflare.net`, port 465 with SSL only; 587 is not supported [2] |
| Username | Your Gmail address | The words `api_token`, exactly [2] |
| Password | An app password, which needs 2-Step Verification [7] | A Cloudflare API token with **Email Sending: Edit** [2] |
| Before it works | Turn on 2-Step Verification, then create the app password [7] | Onboard the domain under **Email Service** > **Email Sending**; to write to anyone, the Workers Paid plan [2] [5] |
| Signed as your domain? | Check a sent reply, as shown below | Yes: Cloudflare signs every message with DKIM for your domain [2] [4] |
| Cost | Free | 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](https://ayoh.dev/help/cloudflare-smtp-apple-mail-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

| What you see | What to do |
| --- | --- |
| 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](https://ayoh.dev/help/cloudflare-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](https://ayoh.dev/help/cloudflare-shared-email-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](https://ayoh.dev/help/cloudflare-spf-dkim-dmarc).

## 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](https://ayoh.dev/help/getting-started), and the other ways to reply are in [Cloudflare Email Routing: send from your domain](https://ayoh.dev/help/cloudflare-email-routing#options).

> Want to keep your Gmail setup while you try it? Connect a subdomain such as `mail.example.com` to Ayoh. The forward and Send mail as on your main address stay exactly as they are. See [Email Routing on a subdomain](https://ayoh.dev/help/cloudflare-email-routing-subdomain).

## Sources

Read November 25, 2026.

- [1] Cloudflare, [Postmaster](https://developers.cloudflare.com/email-service/reference/postmaster/): Email Routing does not support sending or replying from your domain.
- [2] Cloudflare, [SMTP](https://developers.cloudflare.com/email-service/api/send-emails/smtp/), updated November 24, 2026: server, port, username, token, DKIM signing, error codes and fixes.
- [3] Cloudflare changelog, [Authenticated SMTP submission now available in beta](https://developers.cloudflare.com/changelog/post/2026-06-08-smtp-submission/), June 8, 2026.
- [4] Cloudflare, [Domain configuration](https://developers.cloudflare.com/email-service/configuration/domains/): the sending DKIM record and the `p=reject` DMARC record added at onboarding.
- [5] Cloudflare, [Email Service pricing](https://developers.cloudflare.com/email-service/platform/pricing/): verified destinations on Workers Free, 3,000 included emails and $0.35 per 1,000 on Workers Paid.
- [6] Google, [Send emails from a different address or alias](https://support.google.com/mail/answer/22370): the steps, ports, errors, confirmation email, reply-to, "on behalf of" and the January 2027 change.
- [7] Google, [Sign in with app passwords](https://support.google.com/accounts/answer/185833): 2-Step Verification, and when the option is missing.
- [8] Google, [Extra info next to sender's name](https://support.google.com/mail/answer/1311182): why "via" appears and how senders avoid it.
- [9] Google Workspace, [Set up DMARC](https://knowledge.workspace.google.com/admin/security/set-up-dmarc): SPF and DKIM alignment, and what quarantine and reject do.
- [10] Google, [Trace an email with its full header](https://support.google.com/mail/answer/29436): Show original.
