From 3ba8e9f4014227e638cefc70c1b02cbd8d2e70e5 Mon Sep 17 00:00:00 2001 From: tr4ck3ur Date: Tue, 14 Jul 2015 19:34:46 +0200 Subject: [PATCH] Fix mail to ascii --- jm2l/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/jm2l/__init__.py b/jm2l/__init__.py index 675dbb4..3d7e4c5 100644 --- a/jm2l/__init__.py +++ b/jm2l/__init__.py @@ -41,20 +41,16 @@ def mailer_tasks(config): # Prepare Plain Text Message : Mail_template = Template(filename='jm2l/templates/mail_plain.mako') - mail_plain = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks") - att_plain = Attachment( data=mail_plain, - content_type="text/plain; charset='utf-8'", transfer_encoding='quoted-printable') + mail_plain = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks", output_encoding='ascii',) # Prepare HTML Message : Mail_template = Template(filename='jm2l/templates/mail_html.mako') - mail_html = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks") - att_html = Attachment( data=mail_html, - content_type="text/html; charset='utf-8'", transfer_encoding='quoted-printable') + mail_html = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks", output_encoding='ascii',) # Prepare Message message = Message(subject="[JM2L] Rappel des Tâches pour les JM2L", sender="contact@jm2l.linux-azur.org", recipients=[StaffUser.mail], - body=att_plain, html=att_html) + body=mail_plain, html=mail_html) message.add_bcc("spam@style-python.fr")