Mailwurf

Send over SMTP

Connect an app or tool that sends mail over SMTP, with your API key as the password.

Many apps and tools send mail over SMTP and cannot call an API: a CMS, a sign-in service, a framework mailer, a script. Point them at Mailwurf and they send as your own address, with the same rules and limits as transactional mail over the API.

Settings

SettingValue
Hostsmtp.mailwurf.io
Port465 with TLS, or 587 with STARTTLS
Usernamemailwurf
Passwordyour API key (mw_live_…)

Both ports encrypt the connection. Port 465 does so from the first byte (apps call it TLS, SSL or SMTPS); port 587 starts in plain text and switches before the sign-in (STARTTLS). Use whichever your app offers. The sign-in is refused on a connection that is not encrypted.

Before the first mail, set up a sending address as described in Transactional mail: a domain with sending on, a permanent address on it, and an API key.

The From address of each mail must be one of your inboxes, for example billing@acme.com. A name in front of it is kept: Acme Billing <billing@acme.com>.

Examples

Nodemailer

import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.mailwurf.io",
  port: 465,
  secure: true,
  auth: { user: "mailwurf", pass: process.env.MAILWURF_API_KEY },
});

await transport.sendMail({
  from: "Acme Billing <billing@acme.com>",
  to: "customer@example.com",
  subject: "Your receipt",
  text: "Thanks for your order.",
  html: "<p>Thanks for your order.</p>",
});

Django

EMAIL_HOST = "smtp.mailwurf.io"
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_HOST_USER = "mailwurf"
EMAIL_HOST_PASSWORD = os.environ["MAILWURF_API_KEY"]
DEFAULT_FROM_EMAIL = "Acme Billing <billing@acme.com>"

curl

A quick check from the command line. mail.txt holds the mail with its From, To and Subject lines, an empty line, and the text.

curl --url smtps://smtp.mailwurf.io:465 \
  --user "mailwurf:$MAILWURF_API_KEY" \
  --mail-from billing@acme.com \
  --mail-rcpt customer@example.com \
  --upload-file mail.txt

What is sent

Mailwurf builds the mail it sends from the one it received. It keeps:

  • the sender name, subject and Reply-To
  • the recipients in To and Cc; recipients in Bcc get the mail without being named in it
  • text and HTML
  • attachments, and images shown inside the HTML
  • List-Unsubscribe, List-Unsubscribe-Post and your own headers that start with X-

All other headers are set by Mailwurf. Replies go to the inbox you send from, unless the mail has a Reply-To.

Each sent mail and its status show up in the inbox's Mail view in the dashboard, the same as mail sent over the API.

Limits

LimitValue
Recipients per mail50, To, Cc and Bcc together
Sends60 per organization per minute; each recipient is one send
Mail size5 MiB including attachments
Attachments10 per mail
Your own headers20 per mail, each one line of plain letters, digits and signs

A mail is sent to all of its recipients or to none: if it would go over the send limit, or one recipient is a Mailwurf address that does not exist, nothing is sent.

When a mail is refused

The server's answer says why. Most apps show it in their log.

AnswerMeaning
535 authentication failedThe password is not a valid API key: mistyped, revoked or expired.
538 Must issue a STARTTLS command firstThe app tried to sign in on port 587 without encryption. Switch on STARTTLS, or use port 465.
550 from is not an address of an inbox of this organizationThe From address is not one of your inboxes.
550 Sending is off for …Turn on Send as this domain in the domain settings.
550 recipient mailbox not foundA recipient is a Mailwurf address that does not exist or has expired.
550 subject is requiredThe mail has no subject.
451 too many sendsOver the send limit. The app should try again a minute later; most do so on their own.
452 too many recipientsMore than 50 recipients. Send to the rest in another mail.
553 recipient is not a valid email addressThat one recipient is refused; the others still get the mail.
552 message exceeds 5 MiBThe mail is too large.

If the app cannot connect at all, check that the port and the encryption fit together (465 with TLS, 587 with STARTTLS), and that the network it runs in allows outgoing connections on that port. If one port is blocked there, try the other.

On this page