#36119: Attaching email file to email fails if the attachment is using 8bit
Content-Transfer-Encoding
-----------------------------+--------------------------------------
     Reporter:  Trenton H    |                    Owner:  (none)
         Type:  Bug          |                   Status:  new
    Component:  Core (Mail)  |                  Version:  5.1
     Severity:  Normal       |               Resolution:
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------
Comment (by Trenton H):

 Assuming SMTP is configured for a project:

 {{{#!python
 from django.core.mail import EmailMessage

 email = EmailMessage(
     subject="subject",
     body="body",
     to="[email protected]",
 )
 email.attach_file("problem.eml")
 # or
 email.attach_file("problem.eml", "message/rfc822")
 n_messages = email.send()
 }}}

 I would expect this to work without issue, but as shown above, Django
 appear to either assume ASCII or uses the standard library in a way that
 assumes ASCII.  As a user, I would not expect to need extra steps or
 processing for this code to work without a crash and just attach the file
 instead.

 I don't know about the internals to say how it would be fixed.  Perhaps
 checking the headers of attached messages?  Defaulting to utf-8 somewhere?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36119#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019486f12939-f585a5a8-1f33-433a-9355-074bc8645aab-000000%40eu-central-1.amazonses.com.

Reply via email to