import smtplib
from email.mime.text import MIMEText
from email.header import Header
#登录邮件服务器
smtp_obj = smtplib.SMTP_SSL("smtp.qq.com",465) #设置发件人服务器
smtp_obj.login("xxxxxxx@qq.com","czbdyxpmabigbeid")
#设置邮件内容
msg = MIMEText("Hello,最近还好吗,我是来自Python的测试邮件","plain","utf-8")
msg["From"] = Header("来自Python","utf-8")#发送者
msg["To"] = Header("Bruk","utf-8")#接受者
msg["Subject"] = Header("Python的来信2020-06-03","utf-8")#标题
#发送到多人
smtp_obj.sendmail("90xxxxx5@qq.com",["854165@qq.com","906485495@qq.com"],msg.as_string())