python smtp邮件转发
2014-10-10 13:32
274 查看
#!/usr/bin/python
#decoding=utf-8
import sys
import smtplib
reload(sys)
sys.setdefaultencoding('utf-8')
print 'Content-Type: text/html;charset=utf-8\r\n'
from email.mime.text import MIMEText
sender="****"//发件人的邮箱
receivers="****"//收件人的邮箱
login_user="user"//账户
login_passwd="passwd"//密码
smtp_connect="smtp.qq.com"//连接,如果是163邮箱,则为163.com
msg = MIMEText('mail_content')
msg['From'] = sender
msg['To'] = receivers
msg['Subject'] = 'mail_test'
smtp = smtplib.SMTP()
smtp.connect(smtp_connect)
smtp.login(login_user, login_passwd)
smtp.sendmail(sender, receivers, msg.as_string())
smtp.quit()
#decoding=utf-8
import sys
import smtplib
reload(sys)
sys.setdefaultencoding('utf-8')
print 'Content-Type: text/html;charset=utf-8\r\n'
from email.mime.text import MIMEText
sender="****"//发件人的邮箱
receivers="****"//收件人的邮箱
login_user="user"//账户
login_passwd="passwd"//密码
smtp_connect="smtp.qq.com"//连接,如果是163邮箱,则为163.com
msg = MIMEText('mail_content')
msg['From'] = sender
msg['To'] = receivers
msg['Subject'] = 'mail_test'
smtp = smtplib.SMTP()
smtp.connect(smtp_connect)
smtp.login(login_user, login_passwd)
smtp.sendmail(sender, receivers, msg.as_string())
smtp.quit()
相关文章推荐
- python SMTP 邮件转发
- python smtp发送邮件
- python模块之smtplib: 用python发送SSL/TLS安全邮件
- python模块之smtplib: 用python发送SSL/TLS安全邮件
- python 调用smtp服务器发送邮件实例
- python模块学习 ---- smtplib 邮件发送
- 转:python模块学习 ---- smtplib 邮件发送
- python模块之smtplib: 用python发送SSL/TLS安全邮件
- python模块之smtplib: 用python发送SSL/TLS安全邮件
- python模块学习 ---- smtplib 邮件发送
- python模块学习 ---- smtplib 邮件发送
- 转:python模块学习 ---- smtplib 邮件发送
- python模块学习 ---- smtplib 邮件发送
- python模块学习 ---- smtplib 邮件发送(转)
- PYTHON smtp发邮件功能
- python模块学习 ---- smtplib 邮件发送
- python模块之smtplib: 用python发送SSL/TLS安全邮件
- python - 如何通过GMail发送邮件:smtplib的使用
- Python用smtplib发送邮件
- Python写的smtp发送邮件脚本