I've got a problem with sending emails with russian text from my server. I'm sending emails like this:
from django.core.mail import EmailMultiAlternatives
message = EmailMultiAlternatives(
'some subject',
'',
'from@example.com',
['to@example.com']
)
message.attach_alternative(unicode_text_with_html, "text/html")
message.send()
When this email comes to mail service (i.e. gmail.com) there sometimes occur couple of damaged symbols - Ð � instead of letter. Other letters (even same letters) don't get damaged. When I specify cp1251 encoding (i.e. message.encoding = 'cp1251'
) emails don't get damaged. But there are email services that do not accept cp1251 encoding and give error to user when he tries to read message.
When I use filebased email backend with utf-8 encoding I don't get damaged symbols in message body either. And the charset is set to utf-8.
I wonder how can utf-8 encoded message be broken like that. Is there anything I can do to get rid of that symbols?
P.S.: I use Postfix as email server to send emails
UPDATE: On my test server the situation was exactly the same. I've removed Postfix and replaced it by Qmail. Everything worked fine. I swapped it back and symbols came back again. So my latest guess is that it's Postfix problem. I'll try to tune config.