我正在尝试使用Mailgun 通过 HTTP API 发送如下:
Python:
def send_simple_message(string):
return requests.post(
"https://api.mailgun.net/v2/samples.mailgun.org/messages",
auth=("api", "my-key"),
data={"from": "<me@mydomain.com",
"to": ["to@recipient.com"],
"subject": "",
"text": string})
我的域是使用提供的 CNAME 记录验证的,我尝试发送几个 test string
。
从我的 Python 脚本中根本没有发生任何可见的事情 - 没有出现在已发送的项目 (gmail) 中。所以我通过终端手动尝试,得到了响应:<Response [404]>
.
将地址更新为mydomain.com
(感谢@kwatford)我得到<Response [200]>
(成功)。
但是,这是我发送给自己的一封测试电子邮件(使用不同的地址)。我没有收到消息,而且它不在me@mydomain.com
任何一个的发送框中。我做错了什么?