Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multipart messages to specify content-transfer-encoding on body and html payloads #29

Closed
mmerickel opened this issue Jan 24, 2013 · 3 comments

Comments

@mmerickel
Copy link
Member

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?

@rkintzi
Copy link

rkintzi commented Mar 12, 2013

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')

@rpatterson
Copy link
Contributor

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?

@rpatterson
Copy link
Contributor

@mmerickel clarified that this is only happening with utf-8 and I was only testing with latin-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants