﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19186	fail send utf-8 email	alex_po	nobody	"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('тест', 'тест', 'admin@ya.ru', ['user@yandex.ru']).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)
}}}
"	Bug	closed	Core (Mail)	dev	Release blocker	fixed	mail utf8 python3		Ready for checkin	1	0	0	0	0	0
