Added back a general setting (removed from the Django framework in 1.7) to avoid base64-encoding of UTF-8 email messages.

- Legacy-Id: 9012
This commit is contained in:
Henrik Levkowetz 2015-02-06 12:33:24 +00:00
parent 24abae6d26
commit 970059617e

View file

@ -5,6 +5,8 @@ from email.MIMEText import MIMEText
from email.MIMEMessage import MIMEMessage
from email.MIMEMultipart import MIMEMultipart
from email import message_from_string
from email import charset as Charset
import smtplib
from django.conf import settings
from django.contrib import messages
@ -30,6 +32,10 @@ outbox = []
SMTP_ADDR = { 'ip4':settings.EMAIL_HOST, 'port':settings.EMAIL_PORT}
# Don't BASE64-encode UTF-8 messages so that we avoid unwanted attention from
# some spam filters.
Charset.add_charset('utf-8', Charset.SHORTEST, None, 'utf-8')
def empty_outbox():
outbox[:] = []