zoukankan      html  css  js  c++  java
  • python 发qq邮件

    import smtplib
    from email.mime.text import MIMEText
    msg_from = '979477675@qq.com' # 发送方邮箱
    passwd = 'irgshrccydhibbce' # 填入发送方邮箱的授权码
    msg_to = '979477675@qq.com'
    subject = "python邮件测试" # 主题
    content = "这是我使用python smtplib及email模块发送的邮件"
    msg = MIMEText(content)
    msg['Subject'] = subject
    msg['From'] = msg_from
    msg['To'] = msg_to
    s = smtplib.SMTP_SSL("smtp.qq.com", 465)# 邮件服务器及端口号
    s.login(msg_from, passwd)
    s.sendmail(msg_from, msg_to, msg.as_string())
    print("发送成功")
    s.quit()
    Welcome to visit
  • 相关阅读:
    51Nod
    51Nod
    51Nod
    51Nod
    51Nod
    51Nod
    51Nod
    51Nod --1133 不重叠的线段
    bzoj2440: [中山市选2011]完全平方数
    第三章:基本HTML结构
  • 原文地址:https://www.cnblogs.com/Nolover/p/8651064.html
Copyright © 2011-2022 走看看