Skip to content

Send a Message

Send an email by providing structured parameters.

HeaderRequiredDescription
X-Server-API-KeyYesYour API key
Content-TypeYesapplication/json
ParameterTypeRequiredDescription
tostring[]YesRecipient email addresses (max 50)
fromstringYesFrom address (must be authorized for your server)
subjectstringNoEmail subject line
html_bodystringNoHTML body content
plain_bodystringNoPlain text body content
ccstring[]NoCC recipients (max 50)
bccstring[]NoBCC recipients (max 50)
senderstringNoSender header (if different from from)
reply_tostringNoReply-To address
tagstringNoTag for categorization and webhook filtering
headersobjectNoCustom headers as key-value pairs
attachmentsarrayNoFile attachments (see below)
bouncebooleanNoWhether this is a bounce message

Each attachment is an object with:

FieldTypeDescription
namestringFilename (e.g., invoice.pdf)
content_typestringMIME type (e.g., application/pdf)
datastringBase64-encoded file content
Terminal window
curl -X POST https://m.venmail.io/api/v1/send/message \
-H "X-Server-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["[email protected]"],
"cc": ["[email protected]"],
"from": "[email protected]",
"subject": "Invoice #1234",
"html_body": "<p>Please find your invoice attached.</p>",
"tag": "invoices",
"headers": {
"X-Invoice-ID": "1234"
},
"attachments": [
{
"name": "invoice.pdf",
"content_type": "application/pdf",
"data": "JVBERi0xLjQK..."
}
]
}'
{
"status": "success",
"data": {
"message_id": "[email protected]",
"messages": {
"[email protected]": { "id": 1001, "token": "abc123" },
"[email protected]": { "id": 1002, "token": "def456" }
}
}
}
ErrorDescription
ValidationErrorMissing or invalid parameters
NoRecipientsNo valid recipients provided
NoContentNeither html_body nor plain_body provided
TooManyToAddressesMore than 50 To addresses
FromAddressMissingfrom parameter not provided
UnauthenticatedFromAddressFrom address not authorized for this server
Not authenticated
POST
X-Server-API-Key
Content-Type