Skip to content

Send Raw RFC2822

Send a pre-built RFC2822 message directly. This is similar to sending via SMTP and gives you full control over message formatting.

ParameterTypeRequiredDescription
mail_fromstringYesEnvelope sender address
rcpt_tostring[]YesEnvelope recipient addresses
datastringYesBase64-encoded RFC2822 message
bouncebooleanNoWhether this is a bounce message
Terminal window
# First, base64 encode your RFC2822 message
MESSAGE=$(cat <<'EOF' | base64 -w 0
Subject: Raw message test
Content-Type: text/plain; charset=utf-8
This is a raw RFC2822 message sent via Venmail.
EOF
)
curl -X POST https://m.venmail.io/api/v1/send/raw \
-H "X-Server-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"mail_from\": \"[email protected]\",
\"rcpt_to\": [\"[email protected]\"],
\"data\": \"$MESSAGE\"
}"
{
"status": "success",
"data": {
"message_id": "[email protected]",
"messages": {
"[email protected]": { "id": 2001, "token": "xyz789" }
}
}
}
  • Migrating from another email provider with pre-formatted messages
  • Using a mail library (like Nodemailer) that produces RFC2822 output
  • Sending messages with complex MIME structures
  • Forwarding messages with original formatting preserved