Send Email
Send emails with attachments and custom headers
Authentication
All API requests require authentication using a bearer token in the Authorization header.
Request
Body Parameters
<ParamField body="filename" type="string">
Name of the file including extension
</ParamField>
<ParamField body="X-Priority" type="string">
Email priority level
</ParamField>
<ParamField body="X-Campaign-ID" type="string">
Campaign identifier
</ParamField>
Response
Examples
Basic Email
curl -X POST 'https://api.shoutbox.email/send' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"from": "sender@yourdomain.com",
"to": "recipient@example.com",
"subject": "Hello World",
"html": "<h1>Welcome!</h1>"
}'
{
"success": true,
"message_id": "msg_123abc456def"
}
Email with Attachments and Headers
curl -X POST 'https://api.shoutbox.email/send' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"from": "reports@yourdomain.com",
"name": "Reports Team",
"to": "John Smith <john@example.com>",
"reply_to": "Support Team <support@yourdomain.com>",
"subject": "Monthly Report",
"html": "<h1>Monthly Report</h1><p>Please find your report attached.</p>",
"attachments": [
{
"content": "VGhpcyBpcyBhbiBhdHRhY2htZW50IQo=",
"filename": "report.pdf"
}
],
"headers": {
"X-Priority": "1",
"X-Campaign-ID": "monthly_report_2024"
}
}'
{
"success": true,
"message_id": "msg_789xyz012uvw"
}