ホーム
Send API
Send API
独自ドメインから、APIでメール送信。
アプリから独自ドメインのメールアドレスをAPIで送信できます。ダッシュボードでAPIキーを取得し、次の簡単な例を使って送信できます。
POST https://maillogic.io/v1/send
X-API-Keyヘッダーで認証。
クイックスタート
POSTリクエストとしてAPIでメールを送信。
独自ドメインのメールアドレスから、任意の宛先へプレーンテキストメールを送信します。curlとPythonの例は以下です。
curl -X POST https://maillogic.io/v1/send \ -H "X-API-Key: mlk_0123456789abcdef_N7JqK2vP8xR4mT6yU9cD3fG5hL1sW0aBzEoIuYpQkVc" \ -F "[email protected]" \ -F "[email protected]" \ -F "subject=Hello from MailLogic" \ -F "text_content=This email was sent through the MailLogic API."
import requests response = requests.post( "https://maillogic.io/v1/send", headers={"X-API-Key": "mlk_0123456789abcdef_N7JqK2vP8xR4mT6yU9cD3fG5hL1sW0aBzEoIuYpQkVc"}, data={ "from_email": "[email protected]", "to_email": "[email protected]", "subject": "Hello from MailLogic", "text_content": "This email was sent through the MailLogic API.", }, ) print(response.json())
{ "status": "success", "message": "Email sent from [email protected] to [email protected]", "message_id": "<[email protected]>", "from_email": "[email protected]", "to_email": ["[email protected]"] }
これは簡単な例です。完全なAPIドキュメントではありません
上の例では、Send APIのリクエスト形式を簡単に紹介しています。from_emailには、APIキーにひもづくドメイン上の有効なMailLogicメールアドレスを指定し、SMTPを有効にしてパスワードを設定する必要があります。ドメインの送信用DNSも確認済みでなければなりません。API送信はStarterプランとFounderプランで利用できます。詳しいエンドポイント仕様は今後公開予定です。
APIキーを取得
独自ドメインでメール送信を有効にし、ダッシュボードでAPIキーを作成するとSend APIを利用できます。