Mailwurf

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

  1. Add acme.com as a custom domain, turn on Send as this domain and This domain already has a mail server, then publish its DNS records.
  2. Register a permanent address on it, e.g. billing. It sends as billing@acme.com; replies arrive in that inbox.
  3. Create an API key.

Send

npm install @mailwurf/transactional
import { 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:

SettingValue
Hostsmtp.mailwurf.io
Port465 (TLS) or 587 (STARTTLS)
Usernamemailwurf
Passwordyour 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 text and html.
  • replyTo (reply_to over HTTP) sends replies to one other address instead of the inbox.
  • Up to 10 attachments ({ filename, content, contentType? }, content as 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 organization when from is no inbox of the organization.

On this page