Transactional mail
Send receipts and notifications from your app as your own domain.
Besides testing, Mailwurf can send your app's own mail: receipts, notifications, sign-in links. Recipients see your domain, for example billing@acme.com, while acme.com keeps its mail provider.
Set up
- Add
acme.comas a custom domain, turn on Send as this domain and This domain already has a mail server, then publish its DNS records. - Register a permanent address on it, e.g.
billing. It sends asbilling@acme.com; replies arrive in that inbox. - Create an API key.
Send
npm install @mailwurf/transactionalimport { createMailer } from "@mailwurf/transactional";
const mailer = createMailer(process.env.MAILWURF_API_KEY!);
await mailer.send({
from: "Acme Billing <billing@acme.com>",
to: "customer@example.com",
subject: "Your receipt",
html: "<p>Thanks for your order.</p>",
text: "Thanks for your order.",
});from is an address of one of your inboxes, optionally with a display name. send() resolves once Mailwurf accepted the mail; the inbox's Mail view in the dashboard shows each sent mail and its status.
Without the package, call the API directly:
curl -X POST https://api.mailwurf.io/v1/emails \
-H "Authorization: Bearer $MAILWURF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"billing@acme.com","to":"customer@example.com","subject":"Your receipt","text":"Thanks."}'Send over SMTP
Apps and tools that send mail over SMTP connect with your API key as the password:
| Setting | Value |
|---|---|
| Host | smtp.mailwurf.io |
| Port | 465 (TLS) or 587 (STARTTLS) |
| Username | mailwurf |
| Password | your API key (mw_live_…) |
Over SMTP a mail can go to up to 50 recipients in To, Cc and Bcc. See Send over SMTP for examples, what is kept of the mail, and the server's answers.
Limits
- One recipient per mail over the API and the package, up to 50 over SMTP. At least one of
textandhtml. replyTo(reply_toover HTTP) sends replies to one other address instead of the inbox.- Up to 10
attachments({ filename, content, contentType? },contentas bytes or base64), 5 MiB per mail in total. See Attachments. - 60 sends per organization per minute, shared with sending from tests. More return
429 too many sends. 404 from is not an address of an inbox of this organizationwhenfromis no inbox of the organization.
Mailwurf