Opened 10 years ago

Closed 9 years ago

#2007 closed enhancement (fixed)

Allow sending email in a non-default encoding

Reported by: russblau@… Owned by: adrian
Component: Core (Mail) Version:
Severity: normal Keywords:
Cc: django@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Since #1235, all email is now encoded using the encoding found in the DEFAULT_CHARSET setting. This is fine for a default, but there should be an optional argument added to send_mail() to permit specifying a different encoding for mail when needed.

Change History (6)

comment:1 Changed 10 years ago by adrian

  • Component changed from Core framework to django.core.mail

comment:2 Changed 10 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 9 years ago by simonbun <simonbun@…>

  • Cc django@… added

Maybe Django could use a project wide EMAIL_CHARSET setting that defaults to DEFAULT_CHARSET?

comment:4 follow-up: Changed 9 years ago by Jon Colverson <djangotrac@…>

This would be useful for working around some awkward SpamAssassin behavoir. When using the UTF-8 encoding, Python encodes the mail using BASE64. This triggers a SpamAssassin test (MIME_BASE64_NO_NAME) because it detects a BASE64 attachment without a filename. This gives the mail an extra spamminess of 0.224 points, which is not much, but I'd rather avoid it by encoding my mail with us-ascii or whatever to avoid the BASE64 encoding.

comment:5 in reply to: ↑ 4 Changed 9 years ago by Jon Colverson <djangotrac@…>

Replying to Jon Colverson <>:
As pointed out on the mailing list, my concerns are probably better addressed by ticket:3472.

comment:6 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [5553]) Fixed #2007 -- Added support for configurable encoding of email message bodies.

Note: See TracTickets for help on using tickets.
Back to Top