Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (20 sloc) 1.21 KB

Sending Mail

Important

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
  • Text

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 :Content-Type: application/json. Our message data will be a comma separated key value array.