SMTP capture gateway
Tempx runs a capture-only SMTP server — a sandbox shaped exactly like a real mail server. Your application connects, authenticates and hands over a message as it would with any relay; the gateway stores that message in your Tempx inbox with its original headers intact and never delivers it. Swap two lines of mailer config and your staging environment is incapable of emailing a real customer.
Connection settings
| Setting | Value |
|---|---|
| Host | smtp.tempx.uk |
| Port | 587 (STARTTLS) — port 25 also available |
| Encryption | STARTTLS (Let's Encrypt certificate) |
| Auth | PLAIN / LOGIN |
| Username | tmtp_… (from your account, SMTP section) |
| Password | shown once when the credential is created |
| Limits | 25 recipients / message, 10 MB / message |
nodemailer (Node.js)
import nodemailer from "nodemailer";
const transport = nodemailer.createTransport({
host: "smtp.tempx.uk",
port: 587,
secure: false, // STARTTLS, not implicit TLS
auth: { user: "tmtp_YOUR_USERNAME", pass: "YOUR_PASSWORD" },
});
await transport.sendMail({
from: "My App <app@example.com>",
to: "alice@example.com", // any domain - it will NOT be delivered
subject: "Welcome aboard",
text: "Your verification code is 427159.",
html: "<p>Your verification code is <b>427159</b>.</p>",
});
// the message is now in the inbox paired with this credential
Python (smtplib)
import smtplib
from email.message import EmailMessage
msg = EmailMessage()
msg["From"] = "My App <app@example.com>"
msg["To"] = "alice@example.com" # captured, never delivered
msg["Subject"] = "Welcome aboard"
msg.set_content("Your verification code is 427159.")
with smtplib.SMTP("smtp.tempx.uk", 587) as smtp:
smtp.starttls()
smtp.login("tmtp_YOUR_USERNAME", "YOUR_PASSWORD")
smtp.send_message(msg)
Quick terminal check (swaks)
swaks --to alice@example.com \
--server smtp.tempx.uk:587 \
--auth LOGIN --auth-user tmtp_YOUR_USERNAME --auth-password YOUR_PASSWORD \
--tls --header "Subject: Capture check" --body "Hello from swaks"
Laravel / framework .env
Any framework that speaks SMTP takes the same four values:
MAIL_MAILER=smtp
MAIL_HOST=smtp.tempx.uk
MAIL_PORT=587
MAIL_USERNAME=tmtp_YOUR_USERNAME
MAIL_PASSWORD=YOUR_PASSWORD
MAIL_ENCRYPTION=tls
Capture semantics worth knowing
- Any recipient is accepted. The gateway never checks the To domain against an allowlist — capture-trap by design, so a misconfigured test cannot leak.
- The credential picks the inbox. Each
tmtp_credential is bound to one inbox; use separate credentials per service or environment to keep captures sorted. - Headers are preserved. From, To, Cc and custom headers arrive as sent — useful for asserting on header-based behavior like Reply-To.
- Pair it with a read side. The paired inbox is readable via the web app, the REST API, or an agent over MCP — so the same captured message can feed a UI check and an automated assertion.
Mint a credential and send one
Create a tmtp_ credential, point your mailer at the gateway, and watch the capture land.