# पहला ईमेल भेजें

> ईमेल भेजने की कुंजी बनाएँ और POST /emails कॉल करें। संदेश कतार में आने पर API उसका ID लौटाता है।

प्रत्येक ईमेल एक `POST /emails` अनुरोध के रूप में शुरू होता है. Sendtern इसे वैधता देता है, `200 OK` को अपनी आईडी के साथ लौटाता है, और पृष्ठभूमि में वितरित करता है.

## निवेदन का एनाटोमी

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())
```

## प्रेषक

`from` एक बेयर पता या `Name <address>` स्वीकारता है. भेजने से पहले [सटीक प्रेषक डोमेन की जाँच करें](https://sendtern.com/docs/domains).

## प्राप्तकर्ता

- `to` एक स्ट्रिंग या एक ऐरे लेता है, प्रति ईमेल 50 तक पता।
- `cc` और `bcc` एक ही तरह से काम करते हैं और 50 की ओर गिनती करते हैं।
- `reply_to` सेट करता है कि जवाब कहाँ जाते हैं, उदाहरण के लिए आपका समर्थन इनबॉक्स.

## विषयवस्तु

`html`, `text`, या दोनों भेजें. HTML में 200,000 अक्षर तक हो सकते हैं और सादा पाठ में 100,000 अक्षर तक हो सकते हैं.

## टैग

10 `tags` तक भेजें. प्रत्येक टैग में `name` और `value` है, प्रत्येक में 128 अक्षर, अंक, हाइफ़न या डाउनस्ट्रोक हैं.

## निवेदन के बाद

ईमेल **कतारबद्ध** के रूप में प्रारंभ होता है और प्राप्तकर्ता के सर्वर के जवाब के रूप में [statuses](https://sendtern.com/docs/statuses) के माध्यम से जाता है. किसी भी समय [retrieve it](https://sendtern.com/docs/api-get-email) के लिए लौटाए गए `id` का उपयोग करें.
