SMTP relay

If your application or framework already sends mail over SMTP, point it at Postilon instead of changing code. Emails sent through the relay use the same domains, credits, limits and webhooks as the API.

Settings

Setting Value
Host smtp.postilon.com
Port 587 with STARTTLS, or 465 with TLS from the start
Username postilon
Password An API key (ps_live_… or ps_test_…)

The relay only accepts a password over an encrypted connection, so turn on STARTTLS (port 587) or SSL/TLS (port 465) in your mail settings.

For example, with Nodemailer:

import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.postilon.com",
  port: 587,
  secure: false, // upgraded with STARTTLS
  requireTLS: true,
  auth: { user: "postilon", pass: process.env.POSTILON_API_KEY },
});

await transport.sendMail({
  from: "Acme <hello@acme.com>",
  to: "jane@example.com",
  subject: "Your sign-in code",
  text: "Your code is 482913.",
});

What the relay sends

  • Sender. With a live key, the envelope sender (MAIL FROM) must be on a verified domain in your workspace, and a key limited to one domain can only send from that domain; otherwise the relay answers 550 5.7.1.
  • From. The From header's display name is kept when its address is on the envelope sender's domain; otherwise the email is from the envelope sender.
  • Recipients. Every envelope recipient (RCPT TO) gets the email and uses 1 credit. Those listed in the To and Cc headers appear there; the others are Bcc and never appear in the headers.
  • Content. The relay keeps the subject (including encoded non-ASCII subjects), the plain-text and HTML bodies, attachments, Reply-To and your custom headers, such as X-Entity-Ref-ID. Postilon writes Message-ID, Date, the DKIM signature and the unsubscribe headers itself, and drops trace headers such as Received. Bodies are expected in UTF-8.
  • Size. Messages can be up to 10 MB.

Replies from the relay

Reply Meaning
250 2.0.0 OK: queued as msg_… Accepted. The ID is the email's ID in the dashboard and API.
530 5.7.0 Authentication was tried before TLS. Turn on STARTTLS or use port 465.
535 5.7.8 Wrong password. After 3 failures the connection is closed.
550 5.7.1 The sender domain is not verified or not the key's domain, or sending is paused for the workspace.
451 4.3.0 Not enough credits, or the daily sending limit is reached. Try again later.
552 5.3.4 The message is larger than 10 MB.