我正在测试用gmail和outlook中的MailgunAPI发送电子邮件
我正在从selenium(网页)抓取一张桌子
elem = driver.find_element_by_xpath('//table[@id="mainTable"]')
resp = elem.get_attribute('innerHTML')
给它添加一个主体
resp = "<<!DOCTYPE html><html><head><title>Title of the document</title></head><body>"+str(resp)+"</body></html>"
通过邮枪发送
r = requests.post(
"https://api.mailgun.net/v3/mysandbox.mailgun.org/messages",
auth=("api", "my-key"),
files=attachlist,
data={"from": "mailgun@mysandbox.mailgun.org",
"to": ["recipient1@gmail.com", "recipient@hotmail.com"],
"subject": "the subject",
"text": "The text",
"html": resp}
gmail完美地展示了一切
Outlook以乱码状态显示相同的电子邮件
我做错了什么
任何指导都会很有帮助
目前没有回答
相关问题 更多 >
编程相关推荐