Quickstart
Send your first email with MisarMail in under 5 minutes.
Quickstart
Send a transactional email via the REST API or an SDK in a few steps.
Prerequisites
- A verified sending domain (Dashboard → Domains → Verify)
- An API key with
sendscope (Dashboard → Settings → API Keys)
1. Send with cURL
curl -X POST https://api.misar.io/mail/v1/send \
-H "Authorization: Bearer msk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": { "email": "[email protected]", "name": "Your Name" },
"to": [{ "email": "[email protected]", "name": "Recipient" }],
"subject": "Hello from MisarMail",
"html": "<h1>It works!</h1><p>Your first MisarMail send.</p>",
"text": "It works! Your first MisarMail send."
}'
Successful response:
{
"success": true,
"messageId": "msg_01ABCDEF...",
"accepted": ["[email protected]"]
}
2. Send with the TypeScript SDK
Install the SDK
npm install misarmail
# or
pnpm add misarmail
Initialize the client
import { MisarMailClient } from 'misarmail';
const client = new MisarMailClient({ apiKey: process.env.MISARMAIL_API_KEY! });
Send an email
const result = await client.email.send({
from: { email: '[email protected]', name: 'Your Name' },
to: [{ email: '[email protected]' }],
subject: 'Hello from MisarMail',
html: '<h1>It works!</h1>',
});
console.log(result.messageId);
3. Send with the Python SDK
from misarmail import MisarMail
client = MisarMail(api_key="msk_YOUR_KEY")
result = client.email.send(
from_={"email": "[email protected]", "name": "Your Name"},
to=[{"email": "[email protected]"}],
subject="Hello from MisarMail",
html="<h1>It works!</h1>",
)
print(result.message_id)
Sandbox mode
Test without delivering real emails by adding "sandbox": true to any send request:
{
"sandbox": true,
"to": [{ "email": "[email protected]" }],
"subject": "Test",
"html": "<p>Test</p>"
}
Sandbox sends return a messageId but are never delivered. Use scope sandbox on the API key to restrict a key to sandbox-only.