标签: python django encode
如何解决这个问题,也许可以设置附件文件名的编码?附件名称为中文
mail = EmailMessage(connection=connection) mail.from_email = settings.HERA_EMAIL_USER mail.subject = sub mail.to = [to_user_email] mail.body = body mail.attach(u'{}.xlsx'.format(sub), dt.xlsx)