Mailrelay API Reference

Send email to one or more recipients

POST /send_emails

This method can be used to send an SMTP email from our API to one or more recipients.

The response will return an array with the details of each smtp email including the ID, which can be used to verify the status and tracking info later.

Parameters

NameTypeDescription
from object From header
to array To addresses. You can specify up to 100 recipients in one request.
subject string Subject
html_part string HTML part. This is required if text_part parameter isn't set.
text_part string Plain text part. This is required if html_part parameter isn't set.
text_part_auto boolean Set this to true in order to automatically generate plain text version of your message based on HTML content. If this is true, the you shouldn't send text_part parameter.
headers object This may be used to set custom headers for your emails. Please note that the following headers are reserved and can't be used: `Authentication-Results, Bcc, Cc, DKIM-Signature, Date, Delivered-To, DomainKey-Status, From, List-Id, List-Unsubscribe, List-Unsubscribe-POST, Received, Received-SPF, Return-Path, Sender, Subject, To and User-Agent`.
smtp_tags array SMTP Tags
attachments array An array of attachments.<br><br>A message can contain up to <b>10 attachments</b>. Also note that:<br><br>- Sending large attachments ( more than 5mb ) can cause delivery issues since some servers may reject it.<br>- If your message has more than 100kb, it will use more credits from your package.<br>

Responses

StatusDescription
201 Success
400 The request is invalid. Check if the field names in the request and the request data is valid.
422 A validation error occurred. Check the response body for more information.
401 The API key wasn't sent or is invalid
500 An internal error happened. Try again later.