Ticket #4910: fix_attachment_encoding.diff

File fix_attachment_encoding.diff, 686 bytes (added by anonymous, 8 years ago)
  • django/core/mail.py

     
    287287                mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
    288288        basetype, subtype = mimetype.split('/', 1)
    289289        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)
    291292        else:
    292293            # Encode non-text attachments with base64.
    293294            attachment = MIMEBase(basetype, subtype)
Back to Top