Deploy and run
Email for your apps
Send email from your apps on your own domain, paid per recipient from project credit, with no email provider account to set up.
Your apps can send email (receipts, sign-in codes, alerts) from your own domain, without an account at an email company. Each email costs a fixed small amount from your project's credit.
How to do it: in project settings, open Email for your apps, add the domain you'll send from, and add the DNS records CLI shows (they keep your mail out of spam). Then make a key for your app and send.
"Set up sending email from mail.example.com for my app."
Your apps can send email (receipts, sign-in codes, alerts) from your own domain through CLI, with no account at an email provider. Each recipient costs a fixed price from the project's credit (a tenth of a cent unless the operator changes it).
1. Add your sending domain
In project settings, Email for your apps, add the domain you'll send from (acme.com). CLI shows the DNS records that prove you own it and keep your mail out of spam folders (SPF and DKIM). Add them at your DNS provider, then choose Check records.
If you bought the domain through CLI (/docs/domains-and-networking), CLI writes the records itself: just check them a few minutes later.
POST /v1/projects/:id/email/domains {"domain": "acme.com"}
POST /v1/projects/:id/email/domains/:domainId/verify2. Give your app a key
Create an email key gives you two variables to set on the app:
CLI_EMAIL_URL=https://<your CLI>/v1/email/send
CLI_EMAIL_KEY=clem_…3. Send
await fetch(process.env.CLI_EMAIL_URL, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CLI_EMAIL_KEY}`, "content-type": "application/json" },
body: JSON.stringify({ from: "Acme <[email protected]>", to: "[email protected]", subject: "Your receipt", html: "<p>Thanks!</p>" }),
});| Field | Meaning |
|---|---|
from | An address on a verified domain, optionally with a name |
to | One address or a list of up to 50 |
subject | The subject line |
html and/or text | The body |
replyTo | Optional reply address |
The answer says how many recipients it went to and what it cost. Sending from an address that isn't on a verified domain fails with EMAIL_DOMAIN_UNVERIFIED; nothing is charged when the provider refuses a message.
Limits and costs
A project can send up to 60 messages a minute. Usage for the last 30 days is in Email for your apps and in GET /v1/projects/:id/email. Agents can do all of this with cli_email.
What's not there yet
Receiving email isn't supported yet. For inbound mail, add your provider's MX records to the domain.