# Gửi với cURL

> Gửi trực tiếp từ máy chủ để kiểm tra thiết bị.

## Điều kiện trước

- Một Sendtern [khóa API](https://sendtern.com/docs/authentication) được lưu như `SENDTERN_API_KEY`
- A terminal with `curl` installed (it ships with macOS, Linux and Windows 10+)

1. **Gửi thư điện tử**: 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. **Kiểm tra phản ứng**: Một yêu cầu thành công sẽ trả lại `200 OK` với id email. Dùng nó để tìm email sau này.

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

> **tip:** Thay thế người gửi ví dụ bằng một địa chỉ trên [domain xác thực](https://sendtern.com/docs/domains) của bạn.
