summaryrefslogtreecommitdiffstats
path: root/invoice/mailhelper.py
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2013-02-23 21:31:24 +0100
committerSebastian Reichel <sre@ring0.de>2013-02-23 21:31:24 +0100
commitb388bbd8f9e4363830d971046a9f256b963056c3 (patch)
tree2c2fe673fda0bcdeb47d350a67d0f928cc9588ca /invoice/mailhelper.py
parente4edc7e3f093333f65702e4b547930f0cb4e57a7 (diff)
downloadserial-barcode-scanner-b388bbd8f9e4363830d971046a9f256b963056c3.tar.bz2
fix unicode in receiver
Diffstat (limited to 'invoice/mailhelper.py')
-rw-r--r--invoice/mailhelper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/invoice/mailhelper.py b/invoice/mailhelper.py
index 3beb4c7..0da8cd8 100644
--- a/invoice/mailhelper.py
+++ b/invoice/mailhelper.py
@@ -21,10 +21,10 @@ class MAIL(object):
msg["Date"] = email.utils.formatdate(timestamp, True)
try:
- if receiver.encode("ascii"):
- msg["To"] = receiver
+ if receiver[0].encode("ascii"):
+ msg["To"] = receiver[0] + " <" + receiver[1] + ">"
except UnicodeError:
- msg["To"] = Header(receiver, 'utf-8')
+ msg["To"] = Header(receiver[0], 'utf-8') + " <" + receiver[1] + ">"
if cc != None:
msg["Cc"] = cc