Guides
Send transactional email from defineApi handlers. Default Robodev SMTP or per-project custom SMTP.
Every defineApi handler receives an injected email client. Call email.send to deliver a transactional message through the project's active provider. New and existing projects start on Robodev (default) platform SMTP. Organization members can switch a project to custom SMTP from the dashboard Email page.
v1 is outbound only. There is no inbound mail, template UI, attachments, CC/BCC, or campaign builder. Project-host register welcome, magic-link, and forgot-password mail are sent through the project's SMTP and logged on the Email page. Dashboard forgot-password uses platform SMTP and is not logged on the project Email page. Unlike Storage's serve-only GET /storage/objects/{key}, there is no reserved project-host /email route — api/email.ts is a normal handler.
email.send
Use it from defineApi only. to and subject are required. At least one of html or text is required. Max 50 recipients per send. If from is omitted, the active provider From is used.
- Success resolves { id, status: "sent" }. id is the dashboard log row.
- Failure writes a failed log, then throws. The handler 500s unless you catch, same as a db error.
- html and text bodies are never stored in logs.
Default vs custom
- Robodev (default) — platform SMTP from Starbase env. Missing settings row means Robodev.
- Custom SMTP — per-project host, port, username, password, from, and TLS. Stored in metadata, not the tenant database.
- Switching back to Robodev clears custom fields, including the password.
Dashboard
Open /projects/:id/email. Test the Robodev connection, or validate and save custom SMTP (validate does not persist; save persists only after verify succeeds). Sent attempts appear in a durable log: to, from, subject, status, provider, time, and error. Last 200 rows, newest first.
Operator env
Platform send and Robodev validate need SMTP_HOST and SMTP_FROM. Optional: SMTP_PORT (587), SMTP_USER, SMTP_PASS, SMTP_SECURE (true or 1 for implicit TLS, typically port 465). If those keys are unset, the dashboard still shows Robodev as the default; email.send and Robodev validate fail with a clear error, and custom SMTP still works.