This is a quick tutorial to get you started using our API. We will show you how to send your first email, how to authenticate with our API and tell you more about Mailtarget RESTful API.
Make Your First Request
Give it a go and send your first email. This simple example shows how to send an email with the API in a few easy steps.
- You need to enter
API_KEY. You will needAPI_KEYforaccessToken. To get access to Transactional Mailtarget, you needAPI_KEYwhich you can get in the menu Transactional Email > Domain Management through the Mailtarget Apps. - After you got your
API_KEYyou need to find your credentials, the API Key in the Domain Information section.
curl -s -X POST https://trx.mailtarget.co/outbox -H 'Content-Type: application/json' -d '{ "accessToken": "$MT_APIKEY", "from": "$SENDER_EMAIL", "to": [ "$RECIPIENT_EMAIL" ], "labels": [ "$LABEL_EMAIL" ], "subject": "Hello", "content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"/><title>Hello</title></head><body><h3>My First Email Sent by Mailtarget</h3></body></html>", "track": true }'
| Parameter | Description |
|---|---|
| $MT_APIKEY | Your API Key |
| $SENDER_EMAIL | Sender email address with domain of your register |
| $RECIPIENT_EMAIL | Recipient email address of your test |
| $LABEL_EMAIL | Label email which you use for view report easily |