Python发送邮件
来源:互联网 发布:pushkit python 编辑:程序博客网 时间:2024/05/18 22:40
# -*- coding: cp936 -*-# 甄码农,20120307import smtplibfrom email.mime.text import MIMEText mail_host = 'smtp.126.com'mail_user = 'xxx@126.com'mail_pwd = 'hellopwd'mail_to = 'xxao@gmail.com'mail_cc = 'xx@xx.com'mail_bcc = 'xx@qq.com'content = 'this is a mail sent with python' #表头信息msg = MIMEText(content)msg['From'] = mail_usermsg['Subject'] = 'this is a python test mail'msg['To'] = mail_tomsg['Cc'] = mail_ccmsg['Bcc'] = mail_bcctry: s = smtplib.SMTP() s.connect(mail_host) #login s.login(mail_user,mail_pwd) #send mail s.sendmail(mail_user,[mail_to,mail_cc,mail_bcc],msg.as_string()) s.close() print 'success'except Exception ,e: print e
0 0
- 用Python发送邮件
- Python 发送邮件
- python 邮件发送
- 使用PYTHON发送邮件
- python邮件发送
- python发送邮件程序
- python: 发送邮件
- python发送邮件
- python smtp发送邮件
- python 发送邮件实例
- python发送各类邮件
- 用Python发送邮件
- 用Python发送邮件
- python 发送邮件实例
- Python发送邮件测试
- python发送邮件
- python发送邮件
- python发送邮件
- 监听屏幕点亮和关闭状态
- 4.19
- Simulate Common Stochastic Process
- python实现凤凰新闻监控
- java学习之类与继承
- Python发送邮件
- 使用Camera进行拍照 & 后台静默拍照的思路
- sizeof和strlen的区别
- c++模板
- matlab 写txt 保存日志
- 4.20
- 交换一个整数的相邻奇数位与偶数位(即第0位与第1位交换,第2位与第3位交换...)
- 重放攻击
- hive的安装与操作