Quickstart
From nothing to a delivered email. Four steps, about ten minutes plus DNS propagation.
1. Add a sending domain
You can only send from a domain you have proved you control. Adding one returns every DNS record you need to publish.
curl -X POST https://api.sreemail.com/v1/domains \
-H "Authorization: Bearer $SREEMAIL_KEY" \
-d '{ "name": "yourdomain.com" }'The response contains three DKIM CNAME records, an MX and a TXT for the custom MAIL FROM subdomain, and a suggested DMARC policy.
Note
Publish the MAIL FROM records too, not just DKIM. Without them your Return-Path stays on a shared bounce domain, SPF does not align with your From address, and DMARC fails even though DKIM passes. Verification will not complete until both are live.
2. Publish the records and wait
Verification is polled for you. To see which individual record is still missing — rather than one opaque “pending” — ask for their live status:
curl https://api.sreemail.com/v1/domains/yourdomain.com/records \
-H "Authorization: Bearer $SREEMAIL_KEY"Each record comes back with published: true | false, resolved live over DNS. Most failed onboardings are a single mistyped CNAME, and this is how you find it.
3. Know your limits
Every account has a daily and a monthly send limit, counted in recipients rather than messages — one send to fifty people is fifty. Both are visible on your dashboard, and both are raised on request once you have a delivery history.
Exceeding either returns daily_quota_exceeded or monthly_quota_exceeded with a 429. The send is refused whole, so a request that would cross the line consumes nothing.
4. Send
curl -X POST https://api.sreemail.com/v1/emails \
-H "Authorization: Bearer $SREEMAIL_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: welcome-user-42" \
-d '{
"from": { "email": "hello@yourdomain.com", "name": "Acme" },
"to": "you@example.com",
"subject": "Welcome aboard",
"html": "<p>Glad you're here.</p>",
"text": "Glad you're here."
}'{
"id": "msg_use1_01JQ8N4W2X7YHK3F9TBVCQZR6M",
"status": "queued",
"scheduledAt": null
}Always send both
Include text alongside html. Some clients only render plain text, and an HTML-only message scores measurably worse with spam filters.
Next
- Register a webhook to learn whether the message was delivered —
202means accepted, not delivered. - Create a template so your copy is not embedded in application code.
- Read the deliverability guide before you send volume.