Permalink
Browse files

Merge pull request #2 from JohnFLewis/patch-1

specify utf-8 encoding for header
  • Loading branch information...
2 parents 1261492 + a4cfe59 commit 0d124dd51aeaa200980e99b1f1d4a13cf7498975 @mzmcbride committed Jul 8, 2015
Showing with 2 additions and 1 deletion.
  1. +2 −1 dal.py
View
@@ -3,6 +3,7 @@
import datetime
from email.MIMENonMultipart import MIMENonMultipart
+from email.header import Header
import htmlentitydefs
import urllib
import re
@@ -201,7 +202,7 @@ def send_email(email_to, email_from, email_subject, email_body):
msg['Content-Transfer-Encoding'] = '8bit'
msg.set_payload(email_body, 'utf-8')
msg['From'] = email_from
- msg['Subject'] = email_subject
+ msg['Subject'] = Header(email_subject, 'utf-8')
server = smtplib.SMTP(config.smtp_host, config.smtp_port)
server.ehlo()
server.starttls()

0 comments on commit 0d124dd

Please sign in to comment.