# 送信先 cURL

> ターミナルから直接送信して設定をテストしてみろ

## 前提条件

- Sendtern [API キー](https://sendtern.com/docs/authentication) が `SENDTERN_API_KEY` として保存されます
- A terminal with `curl` installed (it ships with macOS, Linux and Windows 10+)

1. **メールを送信**: Run this in your terminal.

```
curl -X POST https://sendtern.com/emails \
  -H "Authorization: Bearer $SENDTERN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@mail.example.com>",
    "to": ["you@example.com"],
    "subject": "Hello from the terminal",
    "html": "<p>It works!</p>"
  }'
```

2. **応答をチェック**: 成功した要求は、メール id を含む `200 OK` を返します。これを使って後でメールを検索してください。

```
{
  "id": "47be30ca-24b7-48fb-b35d-ff287b89e66d"
}
```

> **tip:** 例の送信者を自分のメールアドレスで置き換えます。 [確認されたドメイン](https://sendtern.com/docs/domains).
