Encode email subject

#162599
This commit is contained in:
Raimon Esteve 2023-10-18 08:01:46 +02:00
parent f9234a984b
commit 0c030730a8

View file

@ -1105,11 +1105,11 @@ class Report(DeactivableMixin, ModelSQL, ModelView):
}
report = HTMLReport.execute(records, data)
if report:
if report and report[1]:
msg = MIMEMultipart()
msg['To'] = execution.report.to
msg['From'] = execution.report.smtp.smtp_email
msg['Subject'] = Header(execution.report.subject, 'utf-8')
msg['Subject'] = Header(execution.report.subject, 'utf-8').encode()
msg.attach(MIMEText('Business Intelligence', 'plain'))
part = MIMEBase('application', 'octet-stream')