python 发送Gmail邮件
2012-08-02 18:50
337 查看
#!/usr/bin/python import smtplib from email.Message import Message from time import sleep smtpserver='smtp.gmail.com' username='hzhida95@gmail.com' password='*******' from_addr='hzhida95@gmail.com' to_addr='hzhida2011@gmail.com' cc_addr='1241224798@qq.com' message=Message() message['Subject']='Mail Subject' message['From']=from_addr message['To']=to_addr message['Cc']=cc_addr message.set_payload('mail content') msg=message.as_string() sm=smtplib.SMTP(smtpserver,port=587,timeout=20) sm.set_debuglevel(1) sm.ehlo() sm.starttls() sm.ehlo() sm.login(username,password) sm.sendmail(from_addr,to_addr,msg) sleep(5) sm.quit()
相关文章推荐
- python - 如何通过GMail发送邮件:smtplib的使用
- 使用gmail发送邮件的Python脚本
- Python接收Gmail新邮件并发送到gtalk的方法
- python使用smtplib模块通过gmail实现邮件发送的方法
- 用Python登录Gmail并发送Gmail邮件的教程
- Python接收Gmail新邮件并发送到gtalk的方法
- Python 使用Gmail发送邮件
- python使用smtplib模块通过gmail实现邮件发送的方法
- 使用gmail发送邮件的Python脚本
- python - 如何通过GMail发送邮件:smtplib的使用
- python 实现邮件自动发送
- Python自动发送邮件功能
- Python SMTP发送邮件
- Python3 使用smtplib和email模块发送邮件
- python模块学习 ---- smtplib 邮件发送(转)
- 利用asp.net自带邮件组件 发送邮件,支持126,163,gmail,qq等邮箱
- python发送包含html、图片、附件和链接的邮件
- python中发送邮件各种问题
- 利用python调用elasticsearch-api来分析数据并作图进行日报邮件发送
- [置顶] 利用Python 提醒实验室同学值日(自动发送邮件)