Python 发送Email
来源:互联网 发布:日语软件测试工程师 编辑:程序博客网 时间:2024/05/19 18:10
Python 发送邮件(Email)
公司最近有后台在某些条件下发送邮件给客户的需求。所以找了些demon,记录下。
import smtplib import email.mime.multipart import email.mime.text msg = email.mime.multipart.MIMEMultipart() msg['Subject'] = 'test' msg['From'] = 'testxxxx@126.com' msg['To'] = 'testxxxx@qq.com' content = ''''''' 你好,test 这是一封自动发送的邮件。 www.test.com ''' txt = email.mime.text.MIMEText(content) msg.attach(txt) #smtp = smtplib smtp = smtplib.SMTP() smtp.connect('smtp.126.com', '25') smtp.login('testxxxx@126.com', '******') smtp.sendmail('testxxxx@126.com', '199xxxx@qq.com', msg.as_string()) smtp.quit()
163 smtp 服务器
# smtp.163.comsmtp.connect('smtp.163.com', '25')
阿里企业邮箱 smtp 服务器
# smtp.mxhichina.comsmtp.connect('smtp.mxhichina.com', '25')
qq smtp 服务器
# smtp.126.comsmtp.connect('smtp.126.com', '25')
阅读全文
0 0
- Python发送Email
- Python 发送Email
- python 发送Email程序
- python发送email
- python实现发送email
- Python 发送Email
- python 简单email发送
- Python发送邮件(Email SMTP)
- python发送Email 带附件
- python 发送email到qq
- python 发送email到qq
- Python 发送email的方法
- Python QQ 发送Email SMTP
- python网络爬虫-Email发送
- 【转】用Python发送email示例
- 发送email给列表中的邮箱--python
- [Python] 发送email的几种方式
- python 简单的发送email方法
- SVN版本update冲突详解
- 《分布式服务架构原理设计与实战》第8章敏捷开发笔记
- 内存泄露和内存溢出
- Android不使用图片框架,实现加载类似微博超长图片的技巧手法;
- 【动规】POJ 1141 Brackets Sequence
- Python 发送Email
- 初识JQuery,上课笔记
- 将查询的数据写到redis缓存中
- React Native 入门(二)
- C语言与VT100控制码编程
- PyTorch学习
- 2462: [BeiJing2011]矩阵模板
- make menuconfig出错,ncurses安装失败
- 内存溢出和内存泄漏的区别