[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-26 Thread Ervin Hegedüs
Ervin Hegedüs added the comment: David, many thanks for your information. I think my e-mail format was correct - I've copied it from a maildir, as an "email file". As I wrote, there is a solution: before the code passes the 'msg' argument to sendmail() function, it needs to encode() it as "u

[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-26 Thread R. David Murray
R. David Murray added the comment: Oh, and as for why this worked in python2: in python2 strings were binary, not unicode, so the non-ascii stuff was already in bytes form. -- ___ Python tracker __

[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-26 Thread R. David Murray
R. David Murray added the comment: Although that will work for text-only messages if you know what RFC format looks like, you really don't want to do that in the general case, since you can't express messages that have binary non-text content using unicode. What you want to do is prepare your

[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-26 Thread Ervin Hegedüs
Ervin Hegedüs added the comment: Here is a workaround: server.sendmail(mailfrom, rcptto, msg.encode("utf8")) May be this would be better inside of smtplib? -- ___ Python tracker __

[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-25 Thread Ervin Hegedüs
New submission from Ervin Hegedüs: Looks like smtplib can send only messages, which contains only 7bit (ascii) characters. Here is the example: # -*- coding: utf8 -*- import time import smtplib mailfrom = "m...@mydomain.com" rcptto = "m...@otherdomain.com" msg = """%s From: Me <%s> To: %s Su

[issue25736] smtplib can't send 8bit encoded utf-8 message

2015-11-25 Thread Ervin Hegedüs
Changes by Ervin Hegedüs : -- nosy: airween priority: normal severity: normal status: open title: smtplib can't send 8bit encoded utf-8 message type: behavior versions: Python 3.4 ___ Python tracker ___