废话不多说,直接上代码
Python2.7
代码如下 | 复制代码 |
#!/usr/bin/env python2.7 # -*- coding=utf-8 -*-
importsmtplib fromemail.mime.textimportMIMEText _user="[email protected]" _pwd="这里改成你的授权码" _to ="[email protected]"
msg=MIMEText("this is a email from python,ha ha ha ...") msg["Subject"]="这里是主题" msg["From"]=_user msg["To"]=_to
try: s=smtplib.SMTP_SSL("smtp.qq.com",465) s.login(_user, _pwd) s.sendmail(_user, _to, msg.as_string()) s.quit() print"发送成功" excepts.smtplib.SMTPException, e: print"发送失败" |
Python3.6
代码如下 | 复制代码 |
#!/usr/bin/env python3.6 # -*- coding=utf-8 -*-
importsmtplib fromemail.mime.textimportMIMEText _user="[email protected]" _pwd="这里改成你的授权码" _to ="[email protected]"
msg=MIMEText("this is a email from python,ha ha ha ...") msg["Subject"]="这里是主题" msg["From"]=_user msg["To"]=_to
try: s=smtplib.SMTP_SSL("smtp.qq.com",465) s.login(_user, _pwd) s.sendmail(_user, _to, msg.as_string()) s.quit() print("发送成功") except(s.smtplib.SMTPException, e): print("发送失败") |
火柴人绳索英雄2无限金币版 (Stickman Rope Hero 2)安卓版v2.2v3.4.2
下载奥特曼之格斗超人内测版本 安卓最新版v11.0.0
下载奥特曼之格斗超人百度版 安卓版v11.0.0
下载奥特曼之格斗超人4399游戏盒版 最新安卓版v11.0.0
下载德凯奥特曼D闪光剑模拟器 安卓版v1.0
德凯奥特曼D闪光剑模拟器是一个非常有趣的奥特曼变身模拟器,可
亚刻觉醒器 安卓版v1.1
亚刻觉醒器模拟器是一个非常有趣的奥特曼变身模拟器,为喜欢亚刻
海上餐厅无限金币版 v1.0
海上餐厅免广告版是游戏的破解版本,在该版本中为玩家去除了广告
阿西美女室友竟然全解锁版 v1.0.2
阿西美女室友竟然内置菜单版是游戏的破解版本,在该版本中为玩家
我是大东家正版 最新版v1.2.738
我是大东家正版是一款放置类模拟经营手游,玩家将回到古代成为家