selenium 【美洲杯赌球】python smtp邮件

#code:utf-8

import smtplib from email.mime.text import MIMEText

from email.mime.multipart import MIMEMultipart

from email.header import Header

smtpserver = 'smtp.163.com'

smtp_user = '*******'

smtp_pass = '*******'

from_addr='**********@163.com'

to_addr= '********@qq.com'

subject = '休假申请'

#message = MIMEMultipart()

message = MIMEText('这是今天的休假申请','plain','utf-8')

message['Subject']美洲杯赌球, = Header(subject,'utf-8')

message['From'] = from_addr

message['To'] = to_addr

#注释部分为带附件的代码

#message.attach(message_text)

#att1=MIMEText(open('test.txt','rb').read(),'base64','utf-8')

#att1['Content-Type'] = 'application/octet-stream'

#att1['Content-Disposition'] = 'attachment:filename="test.txt"'

#message.attach(att1)

sm=smtplib.SMTP()

sm.connect(smtpserver,25)

sm.login(smtp_user,smtp_pass)

sm.sendmail(from_addr,to_addr,message.as_string())

sm.quit()

本文由美洲杯赌球发布于计算机教程,转载请注明出处:selenium 【美洲杯赌球】python smtp邮件

TAG标签: 美洲杯赌球
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。