﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29830	EmailMessage may ignore quote printable encoding	Jannik Schürg	nobody	"I want to change the body encoding (base64, quoted-printible) of an email. Example code:

{{{
#!python
from email import charset
from django.core.mail import EmailMessage

msg = EmailMessage(""Subject"", ""Hello World"")
encoding = charset.Charset(""utf-8"")
encoding.body_encoding = charset.QP
msg.encoding = encoding
print(msg)  # Is not encoded with quoted-printables
}}}

The quoted-printible encoding in this case is overwritten in `SafeMIMEText`. The `encoding` property of `EmailMessage` seems not to be documented? I attached a patch which changes the bahvior of SafeMIMEText for the case a `email.charset.Charset` object was given.

Another idea is to add a new property to `EmailMessage.__init__` which allows to set the body encoding.

Versions 1.11 through master are affected.
"	Bug	closed	Core (Mail)	dev	Normal	fixed	email, mail, encoding		Accepted	1	0	0	0	0	0
