Skip to documentation

Quickstarts

Send with SMTP

Submit messages through your installation’s TLS SMTP gateway.

Prerequisites

An operator must deploy the SMTP gateway. SMTP starts disabled for every team; any member can enable it in Settings → SMTP, which also shows the host to use. Use a verified sender and an os_ sending or full-access key.

Connection settings

SettingValue
HostYour installation’s SMTP hostname, such as smtp.example.com
Port465 (implicit TLS) or 587 (STARTTLS, required before AUTH)
Usernameopensend
PasswordYour os_ API key

TLS 1.2 or newer is required, and the AUTH mechanisms are PLAIN and LOGIN. OAuth tokens are not accepted. A sending key restricted to a domain can only send from that domain.

Send

bash
pnpm add nodemailer
typescript
import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.example.com",
  port: 465,
  secure: true,
  auth: { user: "opensend", pass: process.env.OPENSEND_API_KEY },
});
await transport.sendMail({
  from: "Acme <hello@example.com>",
  to: "you@example.net",
  subject: "Hello over SMTP",
  text: "Your first SMTP message.",
  headers: { "Opensend-Idempotency-Key": "welcome-user-123" },
});

Try it

Inspect Emails and Logs for /smtp/auth and /smtp/emails. A 250 Queued as <email id> reply means the message is durably queued, not delivered. A message can have at most 50 recipients and 40 MiB of MIME data. Opensend-Idempotency-Key makes a retry of the same message safe for 24 hours and is removed from the delivered email. For port 587, set secure: false and requireTLS: true. Do not disable certificate verification. Reuse a connection for multiple messages to reduce authentication requests.