python STMP

Posted Adam_LBQ

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python STMP相关的知识,希望对你有一定的参考价值。

import smtplib
from email.header import Header
from email.mime.text import MIMEText
server = smtplib.SMTP(‘smtp.163.com‘, 25)
server.login(‘[email protected]‘, ‘LBQ139196‘)
msg = MIMEText(‘hello, send by Python...‘, ‘plain‘, ‘utf-8‘)
msg[‘From‘] = ‘[email protected] <[email protected]>‘
msg[‘Subject‘] = Header(u‘text‘, ‘utf8‘).encode()
msg[‘To‘] = u‘飞轮海 <[email protected]>‘
server.sendmail(‘[email protected]‘, [‘[email protected]‘], msg.as_string())

  

以上是关于python STMP的主要内容,如果未能解决你的问题,请参考以下文章

python 蟒蛇邮件模块STMP优化版

python 使用stmp发送邮件

Python 使用Stmp服务使用QQ邮箱给某人发送邮件

c# stmp邮件发送

常用python日期日志获取内容循环的代码片段

python 有用的Python代码片段