Skip to content

Commit

Permalink
Don't try to encode things in Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortal committed May 1, 2015
1 parent e1a040d commit 76cea8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion emailtunnel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ def compose(cls, from_, to, subject, body):
message.add_header(
'Date',
datetime.datetime.utcnow().strftime("%a, %d %b %Y %T +0000"))
message.set_body_text(body, 'utf-8')
if six.PY3:
message.set_body_text(body, 'utf-8')
else:
message.set_body_text(body, None)
return message


Expand Down

0 comments on commit 76cea8f

Please sign in to comment.