smtplib

作者: tutu_tutu | 来源:发表于2018-11-27 16:23 被阅读0次

    import smtplib
    import smtplib
    from smtplib import SMTP
    from email.mime.text import MIMEText
    from email.header import Header

    msg = MIMEText('<html><h1>你好!<h1><html>','html','utf-8')

    msg = MIMEText('hello,send by Python.....','plain','utf-8')

    msg['From'] = 'yougege18927446164@163.com'
    msg['To'] = '755680976@qq.com'
    subject = 'python SMTP 测试邮件'
    msg['Subject'] = Header(subject, 'utf8')
    s = smtplib.SMTP() # 实例化SMTP
    s.connect('smtp.163.com', port=25)
    s.login(user='18927446164@163.com', password='7686100589zqx')
    s.sendmail('18927446164@163.com', '755680976@qq.com', msg.as_string())
    s.quit()

    相关文章

      网友评论

          本文标题:smtplib

          本文链接:https://www.haomeiwen.com/subject/pezgqqtx.html