我可以在msg区域插入图像,可以作为附件或html代码。 我尝试过使用html代码,但它只是将html代码作为字符串输出
import pandas as pd
import smtplib
SenderAddress='<xxxx@gmail.com>'
e = pd.read_excel("C:-=-.Email.xls")
emails = e['Emails'].values
server = smtplib.SMTP("smtp.gmail.com:587")
server.starttls()
server.login('xxx@gmail.com', 'xxxxx')
msg = 'image here'
subject = "Test"
body = "Subject: {}\n\n{}".format(subject,msg.as_string())
for email in emails:
server.sendmail(SenderAddress, email, body)
server.quit()
目前没有回答
相关问题 更多 >
编程相关推荐