设置附件头的filename处调用Header方法进行编码设置
废话不说直接上代码
from email. Header import Header
excel_name = r'测试.xlsx'
# 防止网页端和MacOS端邮件附件显示乱码
file_excel_name = Header(excel_name, 'utf-8').encode()
设置附件头的filename处调用Header方法进行编码设置
废话不说直接上代码
from email. Header import Header
excel_name = r'测试.xlsx'
# 防止网页端和MacOS端邮件附件显示乱码
file_excel_name = Header(excel_name, 'utf-8').encode()