Getting Started

Quick Start

This guide walks you through sending your first email with PostMTA in five steps.

Prerequisites

Step 1: Create an API Key

Navigate to Settings → API Keys in your PostMTA dashboard and generate a new key.

Key formats: Test keys start with pmta_test_. Live keys start with pmta_live_.

Step 2: Add and Verify a Sending Domain

Go to Sending Domains → Add Domain and enter your domain. PostMTA will ask you to add three DNS records.

Step 3: Send Your First Email

curl -X POST https://api.postmta.com/v1/messages/send -H "Authorization: Bearer pmta_live_xxxxxxxxxxxx" -H "Content-Type: application/json" -d '{"from":{"address":"hello@example.com","name":"Example Inc"},"to":[{"address":"subscriber@example.com"}],"subject":"Hello from PostMTA","html":"

Hello!

This is my first email via PostMTA.

"}'

Step 4: Track Delivery

curl https://api.postmta.com/v1/messages/msg_01HX5K9P7N3M4Q6R8T2V4W6Y8 -H "Authorization: Bearer pmta_live_xxxxxxxxxxxx"

Statuses: queuedsentdeliveredbounced or complained

Step 5: Set Up Webhook

curl -X POST https://api.postmta.com/v1/webhooks -H "Authorization: Bearer pmta_live_xxxxxxxxxxxx" -H "Content-Type: application/json" -d '{"url":"https://yourapp.com/webhooks/postmta","events":["message.delivered","message.bounced","message.complained"],"secret":"your_signing_secret"}'

Next Steps