# 用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) 上的地址。
