#26802: Sending mails with attachment results in 'bytes' object has no attribute
'encode'
-----------------------------+--------------------------------------
     Reporter:  Brandl       |                    Owner:  nobody
         Type:  Bug          |                   Status:  closed
    Component:  Core (Mail)  |                  Version:  1.9
     Severity:  Normal       |               Resolution:  needsinfo
     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 Brandl):

 {{{
 from post_office import mail
 mail.send(
     '[email protected]',
     '[email protected]',
     subject='My email',
     message='Hi there!',
     attachments={
         'manage.py': 'manage.py',
     },
     priority='now',
 )
 }}}


 As I said, the exception happens while using a third-party library, but
 it's basically a wrapper around the Django core mail functionality:
 https://github.com/ui/django-
 post_office/blob/master/post_office/models.py#L95

--
Ticket URL: <https://code.djangoproject.com/ticket/26802#comment:3>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.11a8f96e85c0db0411cf71ba7db90397%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to