问题:在用python做自动化测试时,将html测试报告在邮件中添加文件发送的过程中,发现发送成功后,文件的后缀为.bin
解决方法:
加一行代码
msg_att["Content-Disposition"] = 'attachment; filename="' + filename
顺便分享一下fiename的命名
now_time = time.strftime('%Y-%m-%d %H:%M:%S') filename = 'report'+now_time+'.html'
问题:在用python做自动化测试时,将html测试报告在邮件中添加文件发送的过程中,发现发送成功后,文件的后缀为.bin
解决方法:
加一行代码
msg_att["Content-Disposition"] = 'attachment; filename="' + filename
顺便分享一下fiename的命名
now_time = time.strftime('%Y-%m-%d %H:%M:%S') filename = 'report'+now_time+'.html'
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。