python发送email
2015-11-26 16:34
543 查看
#!/usr/bin/env python #send_simple_email_by_account.py @2014-08-18 #author: orangleliu import smtplib from email.mime.text import MIMEText SMTPserver = 'smtp.qq.com' sender = '12345678@qq.com' destination = 'typ123456@qq.com' password = "impasswd" message = 'I send a message by Python. hello' msg = MIMEText(message) msg['Subject'] = 'Test Email by Python' msg['From'] = sender msg['To'] = destination mailserver = smtplib.SMTP(SMTPserver, 25) mailserver.login(sender, password) mailserver.sendmail(sender, [destination], msg.as_string()) mailserver.quit() print 'send email success'
测试成功
相关文章推荐
- python调取hive 和sqoop之二
- 用python调用hive和sqoop
- Python Learning Note
- python-print语句
- Python-数据类型
- python (winpython) 下载地址
- [python]python字典
- python3.X安装matplotlib简单方法
- python自学笔记 20151126
- Jenkins自动构建的方法
- [python]python列表、元组
- Python配置第三方库Numpy和matplotlib的曲折之路
- Python基础——zip
- [python]python子字符串的提取、字符串连接、字符串重复
- 如何有效地阅读python文档
- webdriver+python录制百度首页,定位不到问题
- Python-在奇数中寻找素数
- python的for循环中不能修改循环变量i
- Python的decorator学习笔记
- 11.26-----总结前天的Python(x,y)的安装以及Anaconda,Theano的安装。