Currently it's possible to specify the Content-Transfer-Encoding on an attachment, but the body and html keys are left alone. These keys are then simply forwarded on to an email.Message object. Without being able to specify your own encoding on the keys, the Python stdlib email package will base-64 encode the body or the html if it found to require a utf-8 charset. It would be nice if this were overridable such that the body or html were encoded using quoted-printable.
One possibility would be to allow the body and html keys to accept an Attachment object.
Crappy spam filters may score the message down because it doesn't know how to deal with the content.
Does anyone have thoughts on this issue?
You can add following snippet to your __init__.py:
from email import charset
charset.add_charset('utf-8', charset.SHORTEST, charset.QP, 'utf-8')
charset.add_charset('utf8', charset.SHORTEST, charset.QP, 'utf8')
Try to fix two issues:
* Issue #32 (Pylons#32)
* Issue #29 (Pylons#29)
Add test case for quoted-printable encoding of multipart/alternative:
When I try this with a latin-1 character in both the text/plain and text/html parts, it does get encoded quoted printable, see this repoze.sendmail commit: repoze/repoze.sendmail@96c11cf. I also tried this from pyramid_mailer and it also got quoted printable encoded when sent via SMTP. Can you provide a test case?
@mmerickel clarified that this is only happening with utf-8 and I was only testing with latin-1
Allow setting Content-Transfer-Encoding for body and html via Attachm…
Be warned that this may not work for utf-8 on some versions of Python
because of a bug in email.quiprimime: http://bugs.python.org/issue16948