Send email (including templates)
Send email message to the specified sandbox.
post
Authorizations
Api-TokenstringRequired
Pass the API token in the Api-Token
Path parameters
sandbox_idinteger · int64 · min: 1RequiredExample:
Sandbox ID
4015Body
or
or
or
Responses
200
Success. Message has been delivered.
application/json
successbooleanOptionalExample:
truemessage_idsstring[]OptionalExample:
An array of message IDs, one per recipient, in order of To, Cc, Bcc
0c7fd939-02cf-11ed-88c2-0a58a9feac02400
Bad request. Fix errors listed in response before retrying.
application/json
401
Unauthorized. Make sure you are sending correct credentials with the request before retrying.
application/json
429
Billing plan limit exhausted or sandbox rate limit exceeded (see the response for details).
application/json
500
Internal error. Mail was not delivered. Retry later or contact support.
application/json
post/api/send/{sandbox_id}
curl -X POST https://sandbox.api.mailtrap.io/api/send/{sandbox_id} \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"from": {"email": "sender@example.com"},
"to": [{"email": "recipient@example.com"}],
"subject": "Test Email",
"text": "This is a test email sent to sandbox"
}'
{
"success": true,
"message_ids": [
"0c7fd939-02cf-11ed-88c2-0a58a9feac02"
]
}Last updated
Was this helpful?

