欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

python邮件发送 STMP

程序员文章站 2024-03-18 13:53:16
...

总结:stmp发送,pop接受

         几乎没看

感谢的另一种方式,上天就完事了

stmp协议:

无敌TCP fuck

help link:https://blog.csdn.net/zdqdj1/article/details/50655423

python邮件发送 STMP

python邮件发送 STMP

 

 

demo预览

python邮件发送 STMP

# coding=utf-8
import smtplib,time
from email.mime.text import MIMEText

msg_from = '!!!!!'  # 发送方邮箱
passwd = '!!!!!'  # 填入发送方邮箱的授权码
msg_to = '!!!!!!!!!'  # 收件人邮箱

subject = "送你上天"  # 主题
content = "this no is 脏话"         # 正文
msg = MIMEText(content)
msg['Subject'] = subject
msg['From'] = msg_from
msg['To'] = msg_to
while True:
    try:
        s = smtplib.SMTP_SSL("smtp.qq.com", 465)  # 邮件服务器及端口号
        s.login(msg_from, passwd)
        s.sendmail(msg_from, msg_to, msg.as_string())
        print('发送成功');

    except s.SMTPException as e:
        print('发送失败')
    finally:
        s.quit()
    time.sleep(60);

 

相关标签: email