summaryrefslogtreecommitdiffstats
path: root/invoice/mailhelper.py
diff options
context:
space:
mode:
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