Quantcast
Channel: 一言多いプログラマーの独り言
Viewing all articles
Browse latest Browse all 846

Python+Mailgunでメール送信

$
0
0
Python+Mailgunでメール送信です。試しにサンドボックス環境から、メール送信してみました。


def send_simple_message():
return requests.post(
"https://api.mailgun.net/v3/sandbox.mailgun.org/messages",
auth=("api", "YOUR_API_KEY"),
data={"from": "Mailgun Sandbox ",
"to": "to@example.com",
"subject": "テスト",
"text": "マイクのテストです。"})

実際に設定してみたのがこちら

参考サイト
PythonでGETやPOSTなどのリクエストを送信できる「Requests」ライブラリ

Viewing all articles
Browse latest Browse all 846

Trending Articles