来自:http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343463.html#commentform
- import smtplib
- from email.mime.text import MIMEText
- from email.header import Header
-
- sender = ‘***‘
- receiver = ‘***‘
- subject = ‘python email test‘
- smtpserver = ‘smtp.163.com‘
- username = ‘***‘
- password = ‘***‘
-
- msg = MIMEText(‘你好‘,‘text‘,‘utf-8‘)
- msg[‘Subject‘] = Header(subject, ‘utf-8‘)
-
- smtp = smtplib.SMTP()
- smtp.connect(‘smtp.163.com‘)
- smtp.login(username, password)
- smtp.sendmail(sender, receiver, msg.as_string())
- smtp.quit()
目前只是过这种。
python-发送邮件
原文:http://www.cnblogs.com/gxhlog/p/4184839.html