zoukankan      html  css  js  c++  java
  • python接口测试之如何发送邮件

    可以参考菜鸟教程:http://www.runoob.com/python3/python3-smtp.html

    import smtplib
    import email.mime.multipart
    import email.mime.text
    msg=email.mime.multipart.MIMEMultipart()
    msg['from']='mesunyueru@163.com'
    msg['to']='mesunyueru@qq.com'
    msg['subject']='给你的一封信'
    content="你好"
    txt=email.mime.text.MIMEText(content)
    msg.attach(txt)
    smtp=smtplib.SMTP()
    smtp.connect('smtp.163.com')
    smtp.login('mesunyueru@163.com',password)
    smtp.sendmail('mesunyueru@163.com','mesunyueru@qq.com',str(msg))
    

      

  • 相关阅读:
    v-for基本使用
    SSH
    Git 命令
    bower笔记
    gulp使用例子
    yeoman使用例子
    grunt搭建
    不会误解的名字
    Python 多线程 多进程
    Python 协程
  • 原文地址:https://www.cnblogs.com/mesunyueru/p/9188779.html
Copyright © 2011-2022 走看看