X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=main.py;h=f2db15bd7af8bec35e8fa70737f95ef1d67e58d0;hb=795c519c47ce373311b6590b264aa618356a9a49;hp=d772464667f1d582a029762fd6c5d28634f7979e;hpb=71482ea95ddeb20aab4ad186b22ecf11ef2616a3;p=cavote.git diff --git a/main.py b/main.py index d772464..f2db15b 100755 --- a/main.py +++ b/main.py @@ -150,6 +150,7 @@ def password_lost(): "To: %s" % user['email'], "Subject: [Cavote] %s" % gettext(u"Lost password"), "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()).decode('utf-8'), + "Content-type: text/plain; charset=utf-8", "X-Mailer: %s" % VERSION, "", gettext(u"It seems that you have lost your password."), @@ -162,7 +163,7 @@ def password_lost(): gettext(u"If you think this mail is not for you, please ignore and delete it.") ), "\r\n") server = smtplib.SMTP(SMTP_SERVER) - server.sendmail(EMAIL, [user['email']], BODY) + server.sendmail(EMAIL, [user['email']], BODY.encode('utf-8')) server.quit() flash(u"Un mail a été envoyé à " + user['email'], 'info') return render_template('password_lost.html') @@ -284,6 +285,7 @@ def admin_user_add(): "To: %s" % user['email'], "Subject: [Cavote] %s" % gettext(u"Welcome"), "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()).decode('utf-8'), + "Content-type: text/plain; charset=utf-8", "X-Mailer: %s" % VERSION, "", "%(text)s %(user)s!" % {"text": gettext(u"Hi"), "user": user['name']}, @@ -608,6 +610,7 @@ def admin_vote_edit(voteid): "To: %s" % user['email'], "Subject: [Cavote] %s" % gettext(u"A vote has been opened for your group"), "Date: %s" % time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()).decode('utf-8'), + "Content-type: text/plain; charset=utf-8", "X-Mailer: %s" % VERSION, "", "%(text)s %(title)s" % {"text": gettext(u"A vote has been opened and you are in a group concerned by it :"), "title": request.form['title']},