python邮件发送
来源:互联网 发布:php参考手册 编辑:程序博客网 时间:2024/06/14 11:07
1.这里使用代理服务器
#!/usr/bin/pythonimport smtplibfrom email.mime.text import MIMETextfrom email.header import Header#第三方SMTP邮件服务mail_host = 'smtp.***.com'mail_user = '' #用户名mail_pass = ''#密码sender = '***'#发送邮箱reverses = ['123456@163.com'] #接收邮件邮箱message = MIMEText('PYTHON测试邮件','plain','utf-8')message['From'] = Header('来自遥远的测试','utf-8')message['To'] = Header('小熊','UTF-8')subject = 'Python 测试邮件'message['Subject'] = Header(subject, 'utf-8')try: smtpObj = smtplib.SMTP() smtpObj.connect(mail_host, 25) smtpObj.login(mail_user,mail_pass) smtpObj.sendmail(sender, reverses, message.as_string()) print('邮件发送成功')except smtplib.SMTPException: print('error邮件无法发送')
阅读全文
0 0
- 用Python发送邮件
- Python 发送邮件
- python 邮件发送
- 使用PYTHON发送邮件
- python邮件发送
- python发送邮件程序
- python: 发送邮件
- python发送邮件
- python smtp发送邮件
- python 发送邮件实例
- python发送各类邮件
- 用Python发送邮件
- 用Python发送邮件
- python 发送邮件实例
- Python发送邮件测试
- python发送邮件
- python发送邮件
- python发送邮件
- IDEA热部署(三)---jetty插件调试
- 86. Partition List
- mysql的免安装版下载与配置
- 【spring】杂记
- 【项目管理和构建】——Maven简介(一)Maven是什么,以及为什么要使用Maven
- python邮件发送
- Android开发小技巧
- python 获取当前函数的 函数名 sys._getframe().f_code.co_name
- dbutils
- Emgu学习之(一)——Emgu介绍
- Z-function的构造与应用
- 发送有序广播
- 【算法题】快速排序
- Python+Selenium使用Page Object实现页面自动化测试