From d70b5e5d4480d3c7591d2fe15efe8016da34a86c Mon Sep 17 00:00:00 2001 From: helmutm Date: Tue, 2 Feb 2010 10:08:45 +0000 Subject: [PATCH] fix send email feature: encode subject and message correctly git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3710 fd906abe-77d9-0310-91a1-e0d9ade77398 --- integrator/mail/imap.py | 3 +-- organize/browser/party.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/integrator/mail/imap.py b/integrator/mail/imap.py index 9fba519..84a7326 100644 --- a/integrator/mail/imap.py +++ b/integrator/mail/imap.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2007 Helmut Merz helmutm@cy55.de +# Copyright (c) 2010 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -123,7 +123,6 @@ def decodeHeader(h): result.append(v) return ''.join(result) - def getPayload(msg): parts = {} for msg in msg.walk(): diff --git a/organize/browser/party.py b/organize/browser/party.py index 1e3bd79..814fd65 100644 --- a/organize/browser/party.py +++ b/organize/browser/party.py @@ -156,8 +156,8 @@ class SendEmail(FormController): recipients += (form.get('addrRecipients') or u'').split('\n') person = getPersonForUser(self.context, self.request) sender = person and adapted(person).email or 'loops@unknown.com' - msg = MIMEText(message, 'plain', 'utf-8') - msg['Subject'] = subject + msg = MIMEText(message.encode('utf-8'), 'plain', 'utf-8') + msg['Subject'] = subject.encode('utf-8') msg['From'] = sender msg['To'] = ', '.join(r.strip() for r in recipients if r.strip()) mailhost = component.getUtility(IMailDelivery, 'Mail')