UI自动化邮件发送:UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 213: illegal multibyte sequence问题
原代码:
with open('D:\zhang2.html','r') as f:
content = f.read()
part1 = MIMEText(content,'html','utf-8')
修改后的代码:
with open('D:\zhangshuai2.html','r',encoding="utf-8") as f:
content = f.read()
#设置html格式参数
part1 = MIMEText(content,'html','utf-8')

浙公网安备 33010602011771号