python 发送邮件
#发邮件的库import smtplib#邮件文本from email.mime.text import MIMEText#SMTP服务器SMTPServer = "smtp.163.com"#发邮件的地址sender = ""#发送者邮箱的密码passwd = "12345678"#设置发送的内容message = "点开说明你承认我帅了,嘿嘿~"#转换成邮件文本msg = MIMEText(message)#标题msg["Subject"] = "来自帅哥的问候"#发送者msg["From"] = sender#创建SMTP服务器mailServer = smtplib.SMTP(SMTPServer, 25)#登陆邮箱mailServer.login(sender, passwd)#发送邮件mailServer.sendmail(sender, [""], msg.as_string())#退出邮箱mailServer.quit()
相关推荐
zhangwentaohh 2020-09-16
文山羊 2020-08-16
xiaodaiwang 2020-06-12
jacktangj 2019-12-02
meylovezn 2019-10-23
诗眼天涯 2019-04-16
行吟阁 2020-07-04
JasonYeung 2020-06-07
oXiaoChong 2020-06-01
sunnyhappy0 2020-05-19
airfling 2020-05-19
singer 2020-05-06
winmeanyoung 2020-04-11
wenjs00 2020-03-06
zhangpan 2020-01-10
ITxiaobaibai 2020-01-03
huakai 2019-12-29