diff --git a/django/core/mail/message.py b/django/core/mail/message.py
index db9023a..9524bc2 100644
a
|
b
|
from __future__ import unicode_literals
|
3 | 3 | import mimetypes |
4 | 4 | import os |
5 | 5 | import random |
| 6 | import sys |
6 | 7 | import time |
7 | 8 | from email import charset as Charset, encoders as Encoders |
8 | 9 | from email.generator import Generator |
… |
… |
class SafeMIMEText(MIMEText):
|
138 | 139 | """ |
139 | 140 | fp = six.StringIO() |
140 | 141 | g = Generator(fp, mangle_from_ = False) |
| 142 | if sys.version_info < (2, 6, 6) and isinstance(self._payload, six.text_type): |
| 143 | self._payload = self._payload.encode(self._charset.output_charset) |
141 | 144 | g.flatten(self, unixfrom=unixfrom) |
142 | 145 | return fp.getvalue() |
143 | 146 | |