Python发邮件yagmail模块
import yagmail #连接服务器 yag=yagmail.SMTP('xx@163.com','yy','smtp.163.com') #邮箱正文 contents=["test","email send"] #发送邮件 #yag.send('xx@forgame.com','subject',contents) #给多个用户发送邮件,传递一个list #yag.send(['xx','xx1'],'subject',contents) #发送带附件的邮件 yag.send('xx','发送邮件',contents,['r"d:\test.xlsx",r“d:\data.txt”'])