Sending messages requires the purchase of outgoing message credits.
Sending an email uses the outgoing-messages endpoint. This
endpoint is accessed with
POST /api/outgoing-messages. This API uses a POST method, unlike our previous
two examples, which use GET. Several pieces of information are required to send an email.
- Mailsac API Key
- To address
- From address
Since emails without subjects frequently get marked as spam, we are also going to include a subject in our email. Our email
message will be transmitted in JSON, therefore we have to set the content type to :
Our message data will be a comma separated key value array.