Changes between Initial Version and Version 1 of Ticket #27848, comment 5


Ignore:
Timestamp:
Mar 8, 2017, 9:19:26 AM (8 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27848, comment 5

    initial v1  
    55Thanks
    66Dariush
    7 
    8 Replying to [ticket:27848 RAMAGE Sébastien]:
    9 > .eml file could not be attached to EmailMessage using .attach_file() because it raise the following error :
    10 > initial_value must be str or None, not bytes
    11 >
    12 > maybe related to mimetype message/rfc822
    13 >
    14 > {{{
    15 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 292, in send return self.get_connection(fail_silently).send_messages([self])
    16 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/backends/smtp.py", line 107, in send_messages sent = self._send(message)
    17 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/backends/smtp.py", line 121, in _send message = email_message.message()
    18 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 256, in message msg = self._create_message(msg)
    19 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 344, in _create_message return self._create_attachments(msg)
    20 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 357, in _create_attachments msg.attach(self._create_attachment(*attachment))
    21 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 399, in _create_attachment attachment = self._create_mime_attachment(content, mimetype)
    22 > File "/usr/local/lib/python3.5/dist-packages/django/core/mail/message.py", line 380, in _create_mime_attachment content = message_from_string(content)
    23 > File "/usr/lib/python3.5/email/__init__.py", line 38, in message_from_string return Parser(*args, **kws).parsestr(s)
    24 > File "/usr/lib/python3.5/email/parser.py", line 68, in parsestr return self.parse(StringIO(text), headersonly=headersonly)
    25 > TypeError: initial_value must be str or None, not bytes
    26 > }}}
Back to Top