fix encoding for gmail
This commit is contained in:
Родитель
ad8c835a38
Коммит
57fb4a0fd6
|
@ -175,9 +175,10 @@ class api():
|
|||
subject = options.get('subject')
|
||||
|
||||
# XXX TODO: fix headers, etc
|
||||
body = """To: %s
|
||||
body = u"""To: %s
|
||||
From: %s
|
||||
Subject: %s
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
|
||||
%s
|
||||
""" % (to_, from_, subject, message)
|
||||
|
@ -200,7 +201,7 @@ Subject: %s
|
|||
try:
|
||||
server.ehlo_or_helo_if_needed()
|
||||
server.authenticate(url, self.consumer, self.oauth_token)
|
||||
server.sendmail(from_, to_, body)
|
||||
server.sendmail(from_, to_, body.encode('utf-8'))
|
||||
except ValueError, e:
|
||||
error = {"provider": self.host,
|
||||
"message": "%s: %s" % (exc.smtp_code, exc.smtp_error),
|
||||
|
|
Загрузка…
Ссылка в новой задаче