#19186: fail send utf-8 email
-----------------------------+------------------------
Reporter: alex_po | Owner: nobody
Type: Bug | Status: new
Component: Core (Mail) | Version: master
Severity: Normal | Keywords: mail, utf8
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------
When i tried to send email i got error:
{{{
UnicodeEncodeError: 'ascii' codec can't encode characters in position
274-277: ordinal not in range(128)
}}}
Traceback:
{{{
---------------------------------------------------------------------------
UnicodeEncodeError Traceback (most recent call
last)
/home/trosna/.virtualenvs/dj_yourpics/src/django/django/core/management/commands/shell.py
in <module>()
----> 1 EmailMessage('тест', 'тест', '[email protected]',
['[email protected]']).send()
/home/trosna/.virtualenvs/dj_yourpics/src/django/django/core/mail/message.py
in send(self, fail_silently)
253 # send to.
254 return 0
--> 255 return
self.get_connection(fail_silently).send_messages([self])
256
257 def attach(self, filename=None, content=None, mimetype=None):
/home/trosna/.virtualenvs/dj_yourpics/src/django/django/core/mail/backends/smtp.py
in send_messages(self, email_messages)
89 num_sent = 0
90 for message in email_messages:
---> 91 sent = self._send(message)
92 if sent:
93 num_sent += 1
/home/trosna/.virtualenvs/dj_yourpics/src/django/django/core/mail/backends/smtp.py
in _send(self, email_message)
105 try:
106 self.connection.sendmail(from_email, recipients,
--> 107 email_message.message().as_string())
108 except:
109 if not self.fail_silently:
/usr/local/lib/python3.2/smtplib.py in sendmail(self, from_addr, to_addrs,
msg, mail_options, rcpt_options)
733 esmtp_opts = []
734 if isinstance(msg, str):
--> 735 msg = _fix_eols(msg).encode('ascii')
736 if self.does_esmtp:
737 # Hmmm? what's this? -ddm
UnicodeEncodeError: 'ascii' codec can't encode characters in position
274-277: ordinal not in range(128)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19186>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.