送信例
送信先 cURL
ターミナルから直接送信して設定をテストしてみろ
前提条件
- Sendtern API キー が
SENDTERN_API_KEYとして保存されます - A terminal with
curlinstalled (it ships with macOS, Linux and Windows 10+)
- 1
メールを送信
Run this in your terminal.
1curl -X POST https://sendtern.com/emails \ 2 -H "Authorization: Bearer $SENDTERN_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "from": "Acme <hello@mail.example.com>", 6 "to": ["you@example.com"], 7 "subject": "Hello from the terminal", 8 "html": "<p>It works!</p>" 9 }' - 2
応答をチェック
成功した要求は、メール id を含む
200 OKを返します。これを使って後でメールを検索してください。1{ 2 "id": "47be30ca-24b7-48fb-b35d-ff287b89e66d" 3}
例の送信者を自分のメールアドレスで置き換えます。 確認されたドメイン.