Send Raw RFC2822
POST /api/v1/send/raw
Section titled “POST /api/v1/send/raw”Send a pre-built RFC2822 message directly. This is similar to sending via SMTP and gives you full control over message formatting.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
mail_from | string | Yes | Envelope sender address |
rcpt_to | string[] | Yes | Envelope recipient addresses |
data | string | Yes | Base64-encoded RFC2822 message |
bounce | boolean | No | Whether this is a bounce message |
Example
Section titled “Example”# First, base64 encode your RFC2822 messageMESSAGE=$(cat <<'EOF' | base64 -w 0From: [email protected]Subject: Raw message testContent-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 "{ \"data\": \"$MESSAGE\" }"Response
Section titled “Response”{ "status": "success", "data": { "messages": { } }}When to use raw sending
Section titled “When to use raw sending”- 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