python smtp send mail

来源:互联网 发布:知乎 金庸 黄蓉 编辑:程序博客网 时间:2024/05/18 18:02
import smtplibimport base64from email.mime.text import MIMETextsender = 'wwwww6@163.com'mailto = '3331@qq.com'#邮件信息msg =MIMEText("It's a text email!")msg['Subject'] = 'Hello world'msg['to'] = mailtomsg['From'] = sender#连接发送服务器smtp = smtplib.SMTP('smtp.163.com')smtp.login('4446@163.com','444t')#发送smtp.sendmail(sender,mailto,msg.as_string())smtp.quit()print "send finished"

0 0
原创粉丝点击