Skip to main content

Send a Message

Use this guide when your application builds the message body itself.

curl https://transmission.mailtarget.co/v1/layang/transmissions \
-X POST \
-H "Authorization: Bearer $MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Hello from Mailtarget",
"from": { "email": "you@your-verified-domain.com", "name": "Your Name" },
"to": [{ "email": "recipient@example.com" }],
"bodyText": "If you can read this, the integration works.",
"bodyHtml": "<p>If you can read this, the integration works.</p>",
"metadata": {
"order_id": "10042"
}
}'

Persist transmissionId from the response.

{ "transmissionId": "abc123" }

For full request fields, read Transmission API.