---
title: "Get email into inboxes"
description: "Send from your own verified domains on production, keep transactional and marketing mail on separate senders, tighten DMARC and add BIMI, pick a sending region, run the launch checks, and know what happens to an email the deployment cannot deliver."
canonical_url: "https://nuxt-backend.dev/docs/build/email/delivery/deliverability"
---
# Get email into inboxes

> Send from your own verified domains on production, keep transactional and marketing mail on separate senders, tighten DMARC and add BIMI, pick a sending region, run the launch checks, and know what happens to an email the deployment cannot deliver.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- [Source](https://github.com/qruto/nuxt-backend/blob/main/src/convex/delivery.ts)

- **You get:** mail from your own domains that lands in the inbox, sign-in codes kept apart from newsletters, and nobody waiting for an email that never comes.
- **Powered by:** Resend's verified domains (SPF and DKIM records it generates), its sending regions, and the mailbox providers' own rules. DMARC and BIMI are DNS records you publish.
- **The package adds:** the two senders, the launch checks in `doctor --prod`, a DMARC check in `email sync`, and refusals for codes and invitations that could not arrive.

Get your email to real people, and make sure nobody waits for one that never comes. Only a production deployment sends to real addresses: everywhere else, email runs in test mode and reaches Resend's test addresses only. Three settings on production decide it:

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Without it
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        EMAIL_API_KEY
      </code>
    </td>
    
    <td>
      Nothing is sent.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        BACKEND_ENVIRONMENT=production
      </code>
    </td>
    
    <td>
      Test mode: Resend's test addresses, such as <code>
        delivered@resend.dev
      </code>
      
      , receive mail, and nobody else does. <code>
        env push --prod
      </code>
      
       sets it from the production deployment (<a href="https://nuxt-backend.dev/docs/start/concepts/environments#backend_environment">
        Environments
      </a>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        EMAIL_FROM
      </code>
    </td>
    
    <td>
      Mail comes from Resend's onboarding address, which Resend delivers only to test addresses and to its account owner. The package refuses codes, invitations and gifts to every other address.
    </td>
  </tr>
</tbody>
</table>

## Send from your own domain

1. Add your domain in the Resend dashboard, a subdomain such as `auth.panels.app`, and pick its region ([Send from a region](#send-from-a-region)). Publish the DNS records it lists: SPF and DKIM, then a DMARC policy (`p=none` to start).
2. Wait for the dashboard to show the domain as verified.
3. Set the sender in `.env.local` and push it to production:

```bash [.env.local]
EMAIL_FROM="Panels <hello@auth.panels.app>"
```

```bash
npx nuxt-backend env push --prod
```

`EMAIL_FROM` takes the display-name form, and its address must be on the verified domain. Each subdomain is verified on its own. The [Resend](https://nuxt-backend.dev/docs/services/resend) service page walks through the dashboard.

## Separate your senders

Send each stream of mail from a subdomain of its own, and one address per kind of message:

<table>
<thead>
  <tr>
    <th>
      Stream
    </th>
    
    <th>
      Sender
    </th>
    
    <th>
      Subdomain
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Sign-in codes, invitations, receipts of your own
    </td>
    
    <td>
      <code>
        EMAIL_FROM
      </code>
    </td>
    
    <td>
      <code>
        auth.panels.app
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Lifecycle flows, announcements, newsletters
    </td>
    
    <td>
      <code>
        EMAIL_MARKETING_FROM
      </code>
    </td>
    
    <td>
      <code>
        news.panels.app
      </code>
    </td>
  </tr>
</tbody>
</table>

```bash [.env.local]
EMAIL_FROM="Panels <hello@auth.panels.app>"
EMAIL_MARKETING_FROM="Panels <news@news.panels.app>"
```

Verify `news.panels.app` in Resend the same way, then run `npx nuxt-backend env push --prod`. Every send under a [topic](https://nuxt-backend.dev/docs/build/email/preferences) goes out from the marketing sender; everything else from the transactional one. Mailbox providers then judge each subdomain's reputation on its own, and a campaign that draws complaints leaves your sign-in codes alone. Keep marketing off the root domain too, so a damaged reputation never reaches the mail your team sends from it.

`doctor --prod` warns when topics are declared and `EMAIL_MARKETING_FROM` is unset, or when both senders share one domain.

## Tighten DMARC

DMARC tells mailbox providers what to do with mail that claims your domain but fails SPF and DKIM. Start in monitoring mode, then tighten it once every service that sends as you passes:

1. **Monitor.** Publish `v=DMARC1; p=none; rua=mailto:dmarc@panels.app` on `_dmarc.panels.app`. The reports that arrive at `rua` list every source sending as your domain.
2. **Quarantine.** After a few weeks of reports where your own mail passes, change the policy to `p=quarantine`: failing mail goes to spam.
3. **Reject.** Once you trust the reports, `p=reject`: failing mail bounces.

`npx nuxt-backend email sync` reads the DMARC record of each sender's domain and says where it stands, and `doctor --prod` fails when a sender's domain has no DMARC record at all. Gmail, Yahoo and Microsoft require one from bulk senders ([The mailbox providers' rules](#the-mailbox-providers-rules)). Resend's [DMARC guide](https://resend.com/docs/dashboard/domains/dmarc) has the record syntax.

## Show your logo with BIMI

BIMI shows your logo beside your name in Gmail, Yahoo, Apple Mail and other clients. It is a recipe of DNS and certificates, not a package feature. Checked against Resend's guide on 2026-10-25:

1. **Enforce DMARC.** BIMI needs `p=quarantine` or `p=reject` with `pct=100`, on the sending subdomain and on the root domain.
2. **Get a mark certificate.** A Verified Mark Certificate (VMC) needs a registered trademark, and Gmail shows a blue check with it. A Common Mark Certificate (CMC) needs a year of documented use of the logo, and only Gmail and Yahoo accept it. Both take weeks to issue, and want the logo as SVG Tiny P/S.
3. **Publish the record.** A TXT record at `default._bimi.panels.app`: `v=BIMI1; l=https://panels.app/bimi.svg; a=https://panels.app/vmc.pem;`, both over HTTPS.

Mailbox providers show the logo only for domains with steady volume and a clean reputation, so it may take days to appear. Apple Mail also reads Apple Branded Mail, set up in Apple Business Connect. See Resend's [BIMI guide](https://resend.com/docs/dashboard/domains/bimi).

## Send from a region

Resend sends from four regions: `us-east-1` (North Virginia), `eu-west-1` (Ireland), `sa-east-1` (São Paulo) and `ap-northeast-1` (Tokyo). A region belongs to the domain: you pick it when you add the domain, and moving it means adding the domain again. Send from the region nearest your readers.

Set the region you chose in `EMAIL_REGION`, so `doctor --prod` can check that each sender's domain sends from it:

```bash [.env.local]
EMAIL_REGION=eu-west-1
```

A region decides where mail leaves from, not where data lives. Resend stores account data, logs and email metadata in the United States whatever the region ([Resend's data and compliance](https://nuxt-backend.dev/docs/services/resend#data-and-compliance)). Checked on 2026-10-25.

## Check it before launch

`npx nuxt-backend doctor --prod` reads production's email for you. The deployment asks Resend with its own `EMAIL_API_KEY` and reports derived facts only, so neither the key nor an address leaves it:

- **The environment and the sender.** Production's `BACKEND_ENVIRONMENT` is `production`, and `EMAIL_FROM` is set ([`deployment-email-from`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#deployment-email-from)).
- **The sending domain** ([`email-sender-domain`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-sender-domain)). The domain of `EMAIL_FROM` is verified in the Resend account the key belongs to, with sending on. A key restricted to sending can't read it, which `doctor` says: give production a full-access key, or check the dashboard.
- **Bounces and complaints** ([`email-reputation`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-reputation)). The last 7 days against Resend's limits: a bounce rate under 4% and a complaint rate under 0.08%. Above either, Resend may pause the account's sending, and sign-in codes stop with everything else.
- **The quota** ([`email-quota`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-quota)). A free account's daily quota stops every send until midnight UTC once it is reached.

It also checks the marketing sender ([`email-marketing-from`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-marketing-from)) and the region ([`email-region`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-region)). `npx nuxt-backend email sync --prod --dry-run` prints each production sender's DMARC policy and changes nothing; without `--prod` it reads the development deployment.

## Warm up a new domain

A domain with no sending history looks like a spammer when it starts at full volume. Start with your most engaged readers, sign-in codes and receipts first, and raise the volume over two to four weeks. Send a newsletter to your whole list only once the transactional stream has a clean record. See Resend's [warm-up guide](https://resend.com/docs/knowledge-base/warming-up).

## The mailbox providers' rules

Gmail and Yahoo since 2024, and Microsoft since 2025-05-05, hold senders of more than 5,000 messages a day to these rules ([Google's guidelines](https://support.google.com/a/answer/14229414)):

<table>
<thead>
  <tr>
    <th>
      Rule
    </th>
    
    <th>
      How the package meets it
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      SPF and DKIM pass, aligned with the From domain
    </td>
    
    <td>
      The domain records Resend generates
    </td>
  </tr>
  
  <tr>
    <td>
      A DMARC record, at least <code>
        p=none
      </code>
    </td>
    
    <td>
      You publish it; <code>
        email sync
      </code>
      
       checks it
    </td>
  </tr>
  
  <tr>
    <td>
      One-click unsubscribe in marketing mail, honored within 2 days
    </td>
    
    <td>
      Every send under a topic carries RFC 8058 headers, honored at once (<a href="https://nuxt-backend.dev/docs/build/email/preferences#one-click-unsubscribe">
        One-click unsubscribe
      </a>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      A spam complaint rate under 0.1%, never 0.3% or more
    </td>
    
    <td>
      Consent through topics, the <a href="https://nuxt-backend.dev/docs/build/email/preferences#sunset-inactive-readers">
        sunset rule
      </a>
      
      , and Resend's stricter 0.08% limit in <code>
        doctor --prod
      </code>
    </td>
  </tr>
</tbody>
</table>

Follow them whatever your volume: they are what every inbox expects. [Follow email law](https://nuxt-backend.dev/docs/ship/compliance/email-law) covers the legal side, which these rules are not.

## Emails that would not arrive

Better Auth sends sign-in codes and workspace invitations in the background and answers success whatever the send does. Left alone, a code the provider refuses would look sent, and the person would wait for an email that never comes. So the package checks the request first, and refuses it when the email could not arrive:

<table>
<thead>
  <tr>
    <th>
      The deployment
    </th>
    
    <th>
      A code to a real address
    </th>
    
    <th>
      An invitation to a real address
    </th>
    
    <th>
      Either one to a test address
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        development
      </code>
      
      , no <code>
        EMAIL_API_KEY
      </code>
    </td>
    
    <td>
      Printed in the terminal, not sent
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Code printed, invitation refused
    </td>
  </tr>
  
  <tr>
    <td>
      Any other environment, no <code>
        EMAIL_API_KEY
      </code>
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Refused
    </td>
  </tr>
  
  <tr>
    <td>
      A key, outside <code>
        production
      </code>
      
       (test mode)
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Sent
    </td>
  </tr>
  
  <tr>
    <td>
      A key, <code>
        production
      </code>
      
      , no <code>
        EMAIL_FROM
      </code>
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Refused
    </td>
    
    <td>
      Sent
    </td>
  </tr>
  
  <tr>
    <td>
      A key, <code>
        production
      </code>
      
      , <code>
        EMAIL_FROM
      </code>
      
       set
    </td>
    
    <td>
      Sent
    </td>
    
    <td>
      Sent
    </td>
    
    <td>
      Sent
    </td>
  </tr>
</tbody>
</table>

On `development`, a code that is sent prints in the terminal too, so you can sign in without opening the dev inbox.

A refusal is a `503`: `unavailable`, service `email`, reason `test_mode` or `unconfigured`. The sign-in form, the invitation form and the security page show its label:

- **Test mode** (`errors.unavailable_test_mode`): "This app is in test mode and only emails test addresses, so this address can't receive mail here."
- **Not set up** (`errors.unavailable_unconfigured`): "This app can't send email yet."

No code is stored and no invitation is created. The deployment's logs say which setting to change, without the address: look for [`email.undeliverable`](https://nuxt-backend.dev/docs/ship/operate/troubleshooting#log-codes).

A [gift](https://nuxt-backend.dev/docs/build/growth/offers/gifts) is checked the same way: `giftCheckout` refuses a recipient its email would not reach before the purchaser pays. Should the settings change between the checkout and the payment, the paid gift stands and the recipient can still claim it in the app. The email is skipped, and `email.undeliverable` says why. Once the setting is fixed, [replay](https://nuxt-backend.dev/docs/ship/operate/replay) that payment's billing event to send it.

A sign-in code is checked after your [`canSignIn`](https://nuxt-backend.dev/docs/build/auth/sign-in/hooks) gate, so your own refusal is the one a person reads. The code an email change sends to the new address is checked the same way, before it exists. An invitation is checked only once the inviter is signed in, so an anonymous request learns nothing of the deployment. Only email the package sends is checked: an app that passes its own `emailOTP` plugin delivers those codes itself.

An address the provider stopped delivering to, after a hard bounce or a complaint, gets a step of its own at sign-in ([Handle suppressed addresses](https://nuxt-backend.dev/docs/build/email/delivery/suppressions)).

## Keep marketing from stopping sign-in

One Resend account serves every email the app sends: a sign-in code, your own transactional email and a broadcast. A broadcast to a stale list can push the bounce or complaint rate past the limits above. When Resend pauses the account, sign-in codes stop with it. Protect them:

- Send marketing only to people who opted in, through [topics](https://nuxt-backend.dev/docs/build/email/preferences), and let the [sunset rule](https://nuxt-backend.dev/docs/build/email/preferences#sunset-inactive-readers) drop readers who stopped reading.
- Send it from the marketing sender's own subdomain ([Separate your senders](#separate-your-senders)), so mailbox providers judge its reputation apart from your sign-in mail.
- Watch `email-reputation` in `doctor --prod` after each campaign.

A subdomain does not separate the account itself: Resend's rates and its pause cover every domain in it. Keeping the rates low is what keeps sign-in codes flowing.

## Related

- [Resend](https://nuxt-backend.dev/docs/services/resend): the account, the domains and the region.
- [Send transactional email](https://nuxt-backend.dev/docs/build/email/sending#environment): every `EMAIL_*` variable.
- [Let people choose their emails](https://nuxt-backend.dev/docs/build/email/preferences): consent, unsubscribe and the sending rules.
- [Follow email law](https://nuxt-backend.dev/docs/ship/compliance/email-law): consent, the postal address and unsubscribe deadlines.
- [Production checklist](https://nuxt-backend.dev/docs/ship/checklist): these checks with the rest of production's.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
