--- url: https://docs.codefox.ai/self-host/email.md --- # Set up outgoing email This page lets you give every app on the server one sender address, so Foxden can email sign-in links, invitations, signing requests and notifications. ## What does not work without email A new server sends no email until you set it up. Until then: * Invitations, signing requests, password resets, notifications and shared links are not emailed. Each app shows the link instead, and you pass it on by hand. Corsac marks a signing request **Not emailed**, so nobody mistakes silence for delivery. * People cannot sign in to Foxden Admin with an email link. Google, Microsoft or the Owner's setup link still work. Cape sends no email in any case. ## Before you start * A [Resend](https://resend.com) account. Foxden sends through Resend; it is the only email service `foxden` and Admin set up. * Your sending domain added in Resend. Resend shows the DNS records it needs (SPF and DKIM); add them where you manage the domain, and wait until Resend says the domain is verified. * A Resend API key with sending access. It starts with `re_`. ## Set the sender **In Admin:** 1. Open **Server** › **Connections**. 2. On the **Email** card, select **Set up** (or **Change**). 3. In **Sender**, type the name and address your emails come from, for example `Acme `. The address must be on your verified domain. 4. In **Provider key**, paste the Resend API key. Leave it blank to keep the key already saved. 5. Select **Save sender**. The apps that send email restart, which takes a minute or two. **With the CLI:** 1. Run `foxden email set`. 2. Type the address to send from. 3. Paste the Resend key at the hidden prompt. For a script, pass the sender with `--from` and the key from a file or standard input: `foxden email set --from hello@acme.com --resend-key-file resend.key --yes`. Either half can change alone: a new key keeps each app's sender, and a new sender keeps the key the server holds. Both ways write each app's own email settings from the one sender and key, and restart the apps that changed. Run `foxden email` to see who each app sends as and whether it can. An app you add later gets the server's sender and key when you add it from Admin. After `foxden init --products`, run `foxden email sync`. ## Check that mail is delivered Run `foxden checkup`. Its deliverability part looks up your sending domain's records and warns when one is wrong: * **SPF**: one `TXT` record starting `v=spf1`, for example `v=spf1 include:resend.com -all`. Without it, mail is marked as spoofed. Two SPF records, or one ending in `+all`, are also flagged. * **DKIM**: the `resend._domainkey.` record Resend gave you. * **DMARC**: a `TXT` record at `_dmarc.`. Then send yourself something real: invite yourself on **People** in Admin, or send a test signing request in Corsac. ## Using your own mail server instead Fennec, Corsac, Pampas and Library can also send through an SMTP server. Set `SMTP_URL` (`smtp://user:password@host:587`) in that app's settings. Corsac and Pampas also need `EMAIL_BACKEND` set to `smtp`. Fennec and Library use SMTP when they hold no Resend key, or, for Library, when `EMAIL_BACKEND` is `smtp`. For Corsac: ```bash printf '%s' 'smtp://user:password@mail.example.com:587' | foxden config set SMTP_URL --stdin --product corsac foxden config set EMAIL_BACKEND smtp --product corsac foxden restart --product corsac ``` Admin, Culpeo and Arctic send only through Resend, so Admin's email-link sign-in still needs a Resend key. ## Troubleshooting ### Nothing is sent after saving Run `foxden email`: an app that holds only one half (the key or the sender) does not send. Save both again on **Server** › **Connections**, or run `foxden email set` with both. ### Mail lands in spam Run `foxden checkup` and fix every SPF, DKIM or DMARC warning it shows. Records can take a while to reach everyone after you add them.