# 用cURL發送

> 直接從終端發送來測試你的設置。

## 前提條件

- 存儲為 `SENDTERN_API_KEY` 的 Sendtern [API 鍵](https://sendtern.com/docs/authentication)
- 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. **檢查一下反應**: 成功的請求返回 `200 OK` 與電子郵件 ID。使用它以後查看電子郵件。

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

> **tip:** 用您的 [verified domain](https://sendtern.com/docs/domains) 的地址替换示例发件人。
