Introduction
PostStack is an EU-hosted email API: transactional sends, broadcasts, workflows and inbound mail, from code, over SMTP or through an AI agent. This page explains the pieces; the Quickstart sends your first email.
How sending works#
Every email you send goes through the same four steps, whichever interface you use:
- You verify a domain by publishing its SPF and DKIM records, so receiving servers can check the mail really is yours.
- You create an API key — full access, or sending-only and optionally restricted to one domain.
- You send over the REST API, an SDK, the SMTP relay or the MCP server. PostStack answers
202 Acceptedwith anem_…id and queues the message. - Delivery, bounces, opens and clicks arrive as events — in the dashboard, on
GET /emails/:idand as webhooks.
Base URL#
All API requests go to one host. Paths on these pages are relative to it — POST /emails means POST https://api.poststack.dev/emails.
text
https://api.poststack.devRequests and responses are JSON (Content-Type: application/json) over HTTPS. Timestamps are ISO 8601 in UTC. Resource ids are prefixed strings such as em_… for emails and dom_… for domains. All data is processed in the EU — see Data regions.
Ways to send#
| Interface | Use it when |
|---|---|
| REST API | Your code sends mail and wants the id back, events and safe retries. |
| SDKs | TypeScript, Python or Go: typed calls with retries and idempotency built in. |
| SMTP relay | Your framework, CMS or device already speaks SMTP — change the host and password only. |
| MCP server | An AI assistant or agent should send, inspect or manage email for you. |
Quickstarts#
Step-by-step setup for your language and framework, with SDK and SMTP variants:
- Send email with Next.js
- Send email with Bun
- Send email with Express
- Send email with Hono
- Send email with NestJS
- Send email with Nuxt
- Send email with SvelteKit
- Send email with Python
- Send email with Django
- Send email with Flask
- Send email with FastAPI
- Send email with Go
- Send email with Ruby on Rails
- Send email with PHP
- Send email with Laravel
- Send email with Java
- Send email with Spring Boot
- Send email with Elixir
- Send email with Rust
Key concepts#
| Page | What it covers |
|---|---|
| Emails | Send, batch, schedule and cancel emails; read their status and events. |
| Domains | Verify the domains you send from with SPF, DKIM and DMARC records. |
| Authentication | API keys with full or sending-only access, optionally restricted to one domain. |
| Templates | Reusable subjects and bodies with variables, sent by id. |
| Webhooks | Delivery, bounce, open, click and inbound events pushed to your server. |
| Suppressions | Addresses PostStack will not send to after bounces, complaints and unsubscribes. |
| Contacts | Your audience, organised with segments, properties and topics. |
| Broadcasts | Campaigns to a segment, with A/B tests and scheduling. |
| Workflows | Automated sequences triggered by events. |
| Inbound email | Receive mail on your domain and get it as parsed JSON. |
| Mailboxes | Hosted IMAP mailboxes for people, used from any mail client. |
| Email validations | Check an address’s syntax, MX records and risk before you send. |