Django

Code

Changeset 5553

Show
Ignore:
Timestamp:
06/27/07 07:54:15 (1 year ago)
Author:
mtredinnick
Message:

Fixed #2007 -- Added support for configurable encoding of email message bodies.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/mail.py

    r5550 r5553  
    172172    content_subtype = 'plain' 
    173173    multipart_subtype = 'mixed' 
     174    encoding = None     # None => use settings default 
    174175 
    175176    def __init__(self, subject='', body='', from_email=None, to=None, bcc=None, 
     
    190191 
    191192    def message(self): 
    192         msg = SafeMIMEText(self.body, self.content_subtype, settings.DEFAULT_CHARSET) 
     193        encoding = self.encoding or settings.DEFAULT_CHARSET 
     194        msg = SafeMIMEText(self.body, self.content_subtype, encoding) 
    193195        if self.attachments: 
    194196            body_msg = msg