Manual setup: run Send As on your own accounts
The hands-on route. Send through your own email provider or your own relay in your own Cloudflare account, with no Send As account and nothing passing through us. Every step, every setting, every check.
Last updated December 1, 2026
This is the do-it-yourself route. You run the sending infrastructure, so there is no Send As account, no sign-in and no subscription, and no message or credential ever passes through a server of ours. In exchange you handle DNS, keys and a small deployment yourself. Expect 20 to 40 minutes the first time.
If you’d rather have it done in a few minutes, get started on the website instead: we send for you at $5 per address per month. See the Send As relay.
What you are building
Gmail compose → Send As extension (your browser) ──HTTPS + your API key──▶ your email provider
└─HTTPS + relay secret─▶ your relay Worker ──SMTP──▶ your mail host
The extension only ever talks to services you chose. Your keys are encrypted in your browser with a passphrase. Nothing here phones home.
Step 0: decide and gather
| You have… | Route | You’ll need |
|---|---|---|
| An account at Resend, Postmark, SendGrid or Mailgun (or will make one) | A. Provider API | The provider’s API key and a verified sending domain |
| A mailbox at cPanel, GoDaddy, Namecheap or any host with SMTP | B. Your own relay | A free Cloudflare account, GitHub account, SMTP login |
Also confirm before you start:
- Keep your existing Gmail “Send mail as” entry until the replacement has passed a real test.
- Mail to
[email protected]already forwards into your Gmail. Receiving doesn’t change. - You can edit your domain’s DNS records (at your registrar, Cloudflare or host). Write down where.
- You have one place that manages the domain’s SPF record. A domain may only have one.
Route A: send directly through a provider API
Pick one provider. They all work the same way from the extension: your browser calls their HTTPS API with your key.
A1. Create the account and verify your domain
- Create an account and add your domain (the part after the
@). - The provider shows DNS records to add. Add all of them at your DNS host:
- DKIM (a
TXTorCNAMErecord): lets receivers verify the mail came from you. - SPF / return-path (a
TXTorMX/CNAMErecord): authorises the provider’s servers.
- DKIM (a
- Wait until the provider shows the domain as Verified (minutes to a few hours).
| Provider | Where to verify | Key to create | In the extension |
|---|---|---|---|
| Resend | Domains → Add domain | API Keys → “Sending access” for that domain | Resend + the API key |
| Postmark | Sender Signatures → Add domain | Server → API Tokens (the Server API token) | Postmark + the token |
| SendGrid | Settings → Sender Authentication | API Keys → restricted, Mail Send only | SendGrid + the key |
| Mailgun | Sending → Domains → Add domain | Account → API security → a private API key | Mailgun + key, domain, region (US or EU, as shown in your Mailgun dashboard) |
Create a key with the narrowest permission (send only). Never use an account-wide admin key.
A2. Add the address in the extension
- Click the Send As icon → Advanced settings.
- Create a passphrase (8+ characters). It encrypts your keys in this browser; we can’t recover it.
- Choose Add a sending address. Enter
[email protected], a display name, your Gmail address, choose your provider and paste the key. For Mailgun also enter the sending domain and region. - Choose Test & save. The extension first calls your provider (a connection test) and only saves the address if it passes. The browser asks permission for that one provider’s website the first time. Grant it.
Route B: your own relay for SMTP hosts
Browsers can’t open SMTP connections, so for hosts that only offer SMTP you deploy a tiny open-source Worker into your own Cloudflare account. It holds your SMTP login; the extension only holds the relay’s secret.
B1. Gather your SMTP details
From your host (cPanel: Email Accounts → Connect Devices; GoDaddy and others: the “Email client settings” page) you need:
- the SMTP server (for example
mail.yourbiz.com), - the port and security:
465withtls, or587withstarttls(2465and2525also work; port 25 does not work on Workers), - the login (usually the full address) and password. Prefer an app password or SMTP key over your main mailbox password.
The SMTP presets list known-good values for many hosts.
B2. Deploy the relay
One-click: press Deploy to Cloudflare. It copies the relay into your GitHub and deploys it to your Cloudflare. Fill in the settings it asks for.
From the command line (full control, and no GitHub copy):
git clone https://github.com/sagivo/send-as && cd send-as/apps/relay
bun install # or npm install
cp .dev.vars.example .dev.vars # only for local testing; never commit it
npx wrangler login
npx wrangler deploy
# then set each value as a secret (you'll be prompted for the value):
for name in RELAY_SECRET SMTP_HOST SMTP_PORT SMTP_SECURITY SMTP_USER SMTP_PASS ALLOWED_FROM; do
npx wrangler secret put "$name"
done
Generate a strong RELAY_SECRET with openssl rand -base64 32. Set ALLOWED_FROM to the exact addresses the relay may send as (comma-separated). The full table of settings is in the relay docs.
Note the Worker’s address, like https://sendas-relay.your-subdomain.workers.dev.
B3. Test the relay before the extension
curl -s https://YOUR-RELAY.workers.dev/ # health: should say ok
curl -s -H "Authorization: Bearer YOUR_RELAY_SECRET" \
https://YOUR-RELAY.workers.dev/v1/info # should show your SMTP host, not the password
A wrong secret returns Unauthorized. If /v1/info works, the relay is reachable and the secret matches.
B4. Add the address in the extension
Click the icon → Advanced settings, create the passphrase, Add a sending address, choose My own relay, enter the relay URL and RELAY_SECRET, then Test & save. The relay logs in to your SMTP server (without sending anything); the address is only saved if that passes.
Step 1: SPF, DKIM and DMARC (don’t skip)
Without these, Gmail and others may spam-folder or reject your mail. Check from a terminal:
dig +short TXT yourbiz.com # SPF: exactly one "v=spf1 …" record
dig +short TXT _dmarc.yourbiz.com # DMARC policy
dig +short TXT selector._domainkey.yourbiz.com # DKIM: use your provider's selector name
- SPF. One record only. If you already have one (Cloudflare Email Routing adds
include:_spf.mx.cloudflare.net), merge your sender’sinclude:into it, for examplev=spf1 include:_spf.mx.cloudflare.net include:amazonses.com ~all. Stay under 10 DNS lookups. For a relay, authorise your SMTP host, not Cloudflare. - DKIM. Publish exactly what your provider or host gives you. For cPanel, enable DKIM under Email Deliverability.
- DMARC. Start permissive:
v=DMARC1; p=none; rua=mailto:[email protected]. Tighten toquarantineafter a week of passing reports.
The extension can check all three from Advanced settings → Check SPF / DKIM / DMARC on each address (it queries DNS over HTTPS from your browser).
Step 2: file the copies in Gmail
By default each message is also BCC’d to your Gmail so a copy exists. Create the one-time filter described in the Gmail filter guide so those copies are labelled instead of landing in your inbox. For a real Sent Mail copy over IMAP (relay only) see relay settings; it needs a Gmail app password, which grants access to your whole mailbox.
Step 3: prove it works
- In Advanced settings choose Send test email on the address.
- In Gmail start a new message. A From bar appears; choose
[email protected], send to an address at a different provider. - In that inbox choose Show original (or “View headers”) and confirm SPF: PASS, DKIM: PASS, DMARC: PASS and that the From is your address.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| “Permission was declined” | The browser prompt for your provider or relay was dismissed. Choose Test & save again and allow it. |
Unauthorized from the relay |
RELAY_SECRET in the extension differs from the Worker’s. Re-set both. |
| 535 authentication failed | Wrong SMTP login, or a main password where an app password is required. |
| Connection timeout | Wrong host or port, TLS/STARTTLS mismatch, or the host blocks Cloudflare. Try 465 + tls. |
| “Sender not allowed” | The From address isn’t in ALLOWED_FROM. |
| Provider says the domain isn’t verified | DNS records not published yet or added to the wrong zone. Re-check with dig. |
| Mail lands in spam | SPF, DKIM or DMARC missing or failing. See Step 1. |
| No From bar in Gmail | Reload Gmail. If Gmail changed its layout, the popup says so and Gmail’s own Send still works. |
Keeping it safe
- Use the narrowest key your provider offers and revoke it if you stop using Send As.
- Back up your passphrase; a lost one can’t be recovered, you would re-enter your keys.
- Rotate the relay secret by changing
RELAY_SECRETon the Worker and in the extension. - To remove everything: delete the Worker in Cloudflare, revoke the API keys, and remove the extension.
Stuck? Open an issue on GitHub.