Merge pull request #4239 from Apuyuseng/master

Fix mail attachs tcmime *** (#4229)
This commit is contained in:
Andrey Rahmatullin 2019-12-17 19:43:30 +05:00 committed by GitHub
commit 4be2bbfe75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -73,8 +73,7 @@ class MailSender(object):
part = MIMEBase(*mimetype.split('/'))
part.set_payload(f.read())
Encoders.encode_base64(part)
part.add_header('Content-Disposition', 'attachment; filename="%s"' \
% attach_name)
part.add_header('Content-Disposition', 'attachment', filename=attach_name)
msg.attach(part)
else:
msg.set_payload(body)