A 使用 Mailgun 发送 ba 邮件,b 收到邮件后回复 a。如果我想跟踪来自 b 的邮件,如何获取邮件?这是代码:
1.发送邮件.py
from smtplib import SMTP
import requests
login_name = "postmaster@zzb.mailgun.org"
password = "********"
def send_message_via_smtp():
smtp = SMTP("smtp.mailgun.org", 587)
smtp.login(login_name, password)
smtp.sendmail("zebozhuang@163.com","348284770@qq.com", "Subject:mailgun test \n\n just for test.\n\n")
smtp.quit()
if __name__=="__main__":
send_message_via_smtp()
2.create_route.py
import requests
from werkzeug.datastructures import MultiDict
def create_route():
return requests.post(
"https://api.mailgun.net/v2/routes",
auth=("api", "key-9c4-t2q6fouilngjummvtv1rge7t00f2"),
data=MultiDict([("priority", 1),
("description", "Sample route"),
("expression", "match_recipient('.*@qq.com')"),
("action", "forward('qiyazhuang@gmail.com')"),
("action", "stop()")])
)
我创建路由并运行脚本sendmail.py。使用电子邮件348284770@qq.com的人回复使用电子邮件zebozhuang@163.com的其他人后,Gmail无法使用Mailgun方法'转发'接收邮件'。谁能告诉我为什么?