Merge pull request #964 from matclab/mail-send-lazy-to-unicode

#963 : Convert subject and body to unicode before sending mail
This commit is contained in:
mdipierro
2015-05-14 09:17:04 -05:00
+3 -3
View File
@@ -786,16 +786,16 @@ class Mail(object):
if attachments: if attachments:
result = mail.send_mail( result = mail.send_mail(
sender=sender, to=origTo, sender=sender, to=origTo,
subject=subject, body=text, html=html, subject=unicode(subject), body=unicode(text), html=html,
attachments=attachments, **xcc) attachments=attachments, **xcc)
elif html and (not raw): elif html and (not raw):
result = mail.send_mail( result = mail.send_mail(
sender=sender, to=origTo, sender=sender, to=origTo,
subject=subject, body=text, html=html, **xcc) subject=unicode(subject), body=unicode(text), html=html, **xcc)
else: else:
result = mail.send_mail( result = mail.send_mail(
sender=sender, to=origTo, sender=sender, to=origTo,
subject=subject, body=text, **xcc) subject=unicode(subject), body=unicode(text), **xcc)
else: else:
smtp_args = self.settings.server.split(':') smtp_args = self.settings.server.split(':')
kwargs = dict(timeout=self.settings.timeout) kwargs = dict(timeout=self.settings.timeout)