Skip to content

SMTP

If your software can send email over SMTP, it can use SpacePost with no code.

Setting Value
Host smtp.spacepost.dev
Port 25976
Security STARTTLS (required)
Username spacepost
Password Your API key (sp_live_...)

The From address must belong to a verified domain. Implicit TLS (port 465) is not offered yet.

import nodemailer from "nodemailer";
const transport = nodemailer.createTransport({
host: "smtp.spacepost.dev",
port: 25976,
secure: false, // STARTTLS: the connection is upgraded to TLS before login
requireTLS: true,
auth: { user: "spacepost", pass: process.env.SPACEPOST_API_KEY },
});
await transport.sendMail({
from: "Acme <hello@acme.com>",
to: "user@example.com",
subject: "Hello over SMTP",
html: "<p>It works.</p>",
headers: { "X-SpacePost-Tags": "category=welcome" },
});