Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4910 -- Allow Unicode content to be passed in for text-based e…

…-mail

attachments. Thanks, djoume@taket.org.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1777e74d2a53f2b36a3106563c629f85133fbace 1 parent 35ce8a2
Malcolm Tredinnick authored August 11, 2007

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  django/core/mail.py
3  django/core/mail.py
@@ -287,7 +287,8 @@ def _create_attachment(self, filename, content, mimetype=None):
287 287
                 mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
288 288
         basetype, subtype = mimetype.split('/', 1)
289 289
         if basetype == 'text':
290  
-            attachment = SafeMIMEText(content, subtype, settings.DEFAULT_CHARSET)
  290
+            attachment = SafeMIMEText(smart_str(content,
  291
+                settings.DEFAULT_CHARSET), subtype, settings.DEFAULT_CHARSET)
291 292
         else:
292 293
             # Encode non-text attachments with base64.
293 294
             attachment = MIMEBase(basetype, subtype)

0 notes on commit 1777e74

Please sign in to comment.
Something went wrong with that request. Please try again.