# İlk e-postanızı gönderin

> Bir gönderim anahtarı oluşturup POST /emails çağrısı yapın. İleti kuyruğa alındığında API bir kimlik döndürür.

Her e-posta `POST /emails` talep olarak başlar. Sendtern onaylar, `200 OK`'yi ID ile geri gönderir ve arka planda teslim eder.

## İstek anatomisi

cURL:

```
curl -X POST 'https://sendtern.com/emails' \
  -H 'Authorization: Bearer st_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "Acme <hello@mail.example.com>",
  "to": [
    "ada@example.com"
  ],
  "reply_to": "support@example.com",
  "subject": "Your sign-in code",
  "html": "<p>Your code is <strong>482 913</strong></p>",
  "text": "Your code is 482 913",
  "tags": [
    {
      "name": "category",
      "value": "auth"
    }
  ]
}'
```

Node.js:

```
const res = await fetch("https://sendtern.com/emails", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SENDTERN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "from": "Acme <hello@mail.example.com>",
    "to": [
      "ada@example.com"
    ],
    "reply_to": "support@example.com",
    "subject": "Your sign-in code",
    "html": "<p>Your code is <strong>482 913</strong></p>",
    "text": "Your code is 482 913",
    "tags": [
      {
        "name": "category",
        "value": "auth"
      }
    ]
  }),
});

const data = await res.json();
```

Python:

```
import os
import requests

res = requests.post(
    "https://sendtern.com/emails",
    headers={"Authorization": f"Bearer {os.environ['SENDTERN_API_KEY']}"},
    json={
      "from": "Acme <hello@mail.example.com>",
      "to": [
        "ada@example.com"
      ],
      "reply_to": "support@example.com",
      "subject": "Your sign-in code",
      "html": "<p>Your code is <strong>482 913</strong></p>",
      "text": "Your code is 482 913",
      "tags": [
        {
          "name": "category",
          "value": "auth"
        }
      ]
    },
)

print(res.json())
```

## Gönderici

`from` çıplak adresi kabul eder ya da `Name <address>`. [Gönderici alanının doğruluğunu kontrol et](https://sendtern.com/docs/domains) Göndermeden önce.

## Alıcılar

- `to` bir dizi veya bir dizi alır, e-posta başına 50 adrese kadar.
- `cc` ve `bcc` aynı şekilde çalışır ve 50'ye doğru sayılır.
- `reply_to` cevapların nereye gideceğini, örneğin destek posta kutunuzu belirler.

## İçeriği

`html`, `text` veya her ikisini gönderin. HTML 200.000 karaktere kadar ve sıradan metin 100.000 karaktere kadar olabilir.

## Etiketler

10'a kadar `tags` gönderin. Her etiket `name` ve `value`'ye sahiptir, her biri 128 harfe, rakama, bağıntıya veya alt çizgiye kadar.

## İstekten sonra

E-posta **kuyruğa konulmuş** olarak başlar ve alıcının sunucusu cevap verdiği zaman [statuses](https://sendtern.com/docs/statuses) içinden geçer. Her zaman [retrieve it](https://sendtern.com/docs/api-get-email) için geri dönen `id`'yi kullanın.
