Skip to content

CLI quickstart

Use curl to send a test email from your terminal. You need a verified sending domain in Builders, your account ID (DID), and an API key that can send from that domain.

Set COMAIL_DID and COMAIL_API_KEY in your shell. In the command below, replace from with an address on your verified domain and to with a real address you can check. Comail rejects recipients at example.com.

Terminal window
curl -i https://smtp.atmos.email/v1/send \
-H "Content-Type: application/json" \
-H "X-Atmos-DID: $COMAIL_DID" \
-H "Authorization: Bearer $COMAIL_API_KEY" \
--data '{
"from": "you@yourdomain.com",
"to": "recipient@example.com",
"subject": "Comail test",
"text": "This is a test email."
}'

HTTP 200 with a message ID in accepted means Comail queued your email. Check the recipient’s inbox to confirm delivery. If the request fails, look up the error in Troubleshooting.