Opened 9 years ago

Closed 9 years ago

#11934 closed (duplicate)

UnicodeDecodeError while sending an e-mail

Reported by: Goldan Owned by: nobody
Component: Core (Mail) Version: master
Severity: Keywords:
Cc: denis.golomazov@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When I'm trying to send an e-mail using django.core.mail.send_mail function, I get the following error:

DjangoUnicodeDecodeError: 'utf8' codec can't decode bytes in position 27-28: invalid data. You passed in '<20090923114122.7992.11505@\xc4\xe5\xed\xe8\xf1-\xcf\x>' (<type 'str'>)

Let us consider these lines in django/core/

65 idhost = DNS_NAME

66 msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost)

When I replace line 65 with

65 idhost = 'example'

e-mails are sent successfully.

So the problem seems to be that my DNS_NAME contains non-ascii characters.
Hope it will be fixed. Thanks in advance.

Change History (1)

comment:1 Changed 9 years ago by Russell Keith-Magee

Resolution: duplicate
Status: newclosed

I think this might be a variant on #11924.

Note: See TracTickets for help on using tickets.
Back to Top