changed mail subject encoding to avoid errors
This commit is contained in:
parent
3eeef717ba
commit
ceaedd26a8
@ -145,7 +145,7 @@ def send_mail(sender, receiver, subject, body):
|
|||||||
mail = MIMEText(body)
|
mail = MIMEText(body)
|
||||||
mail['From'] = sender
|
mail['From'] = sender
|
||||||
mail['To'] = receiver
|
mail['To'] = receiver
|
||||||
mail['Subject'] = subject
|
mail['Subject'] = subject.decode('latin-1')
|
||||||
mailserver = smtplib.SMTP('localhost')
|
mailserver = smtplib.SMTP('localhost')
|
||||||
mailserver.sendmail(sender, [receiver], mail.as_string())
|
mailserver.sendmail(sender, [receiver], mail.as_string())
|
||||||
mailserver.quit()
|
mailserver.quit()
|
||||||
|
Loading…
Reference in New Issue
Block a user