Learn how to send emails using the MailCub API with code examples in multiple languages.
https://api.mailcub.com/v1/send
curl -X POST https://api.mailcub.com/v1/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@example.com",
"from": "sender@yourdomain.com",
"subject": "Welcome to our service!",
"html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
"text": "Welcome! Thanks for signing up."
}'
Parameter | Type | Required | Description |
---|---|---|---|
to | string | Yes | Recipient email address |
from | string | Yes | Sender email address (must be verified) |
subject | string | Yes | Email subject line |
html | string | No | HTML email content |
text | string | No | Plain text email content |
reply_to | string | No | Reply-to email address |
tags | array | No | Tags for categorizing emails |
{ "id": "msg_1234567890abcdef", "status": "queued", "message": "Email queued for delivery", "created_at": "2025-01-15T10:30:00Z" }
{ "error": { "code": "invalid_parameter", "message": "The 'to' field is required", "details": { "field": "to", "reason": "missing_required_field" } } }
Now that you know how to send emails, explore these advanced features: