Introduction

With Mailsac, it’s super easy to interact with email via REST API, webhooks and websockets. You can reserve and release email addresses, check messages, download attachments, and route mail.

Tip

All API endpoints can be found in the API Documentation


Curl Example

You can use curl to view emails sent to user1@mailsac.com

$ curl -s -X GET https://mailsac.com/api/addresses/user1%40mailsac.com/messages | jq ".[0]"

Information about the most recent email is returned as JSON

{
  "_id": "BotvTxaona7gLID1Adtpfj8Fnfi7HSSv-0",
  "from": [
    {
      "address": "microsoftstore@e.microsoft.com",
      "name": "Microsoft Store"
    }
  ],
  "to": [
    {
      "address": "user1@mailsac.com",
      "name": ""
    }
  ],
  "cc": null,
  "bcc": null,
  "subject": "Ahoy, Sea of Thieves for PC is here",
  "savedBy": null,
  "originalInbox": "user1@mailsac.com",
  "inbox": "user1@mailsac.com",
  "domain": "mailsac.com",
  "received": "2018-03-29T18:28:07.732Z",
  "size": 23420,
  "attachments": null,
  "ip": "65.55.234.211",
  "via": "144.202.71.79",
  "folder": "inbox",
  "labels": [],
  "read": null,
  "rtls": true,
  "links": [
    "href=https://e.microsoft.com/Key-3567701.C.CQZpy.C.K0.-.CMHlNS",
    "http://msstorepromoemail.blob.core.windows.net/windows-store-edits/Nav_MSFT_Logo.jpg",
  ],
  "spam": 1.3370381090039505e-09
}

Tip

This may look for more information than you need. But it provides a great example of all the hard work mailsac has done to make parsing of email easier.