Fix bug with smtplib and crammd5 servers that prevents email sending (#5687)

* Fix bug with smtplib and crammd5 servers that prevents email sending

* Use frappe.safe_decode instead of str

* Revert "Use frappe.safe_decode instead of str"

This reverts commit 272aa167fd86f90129517666b2cad85363026f87.

* Using frappe_encode to 'ascii' to send the password

* Update smtp.py

* Update smtp.py
This commit is contained in:
IOWEB TECHNOLOGIES 2018-07-06 09:36:02 +03:00 committed by Rushabh Mehta
parent c55127f7a2
commit 44f045ca04

View file

@ -171,7 +171,7 @@ class SMTPServer:
if self.email_account:
self.server = self.email_account.smtp_server
self.login = getattr(self.email_account, "login_id", None) or self.email_account.email_id
self.password = self.email_account.password
self.password = frappe.safe_encode(self.email_account.password)
self.port = self.email_account.smtp_port
self.use_tls = self.email_account.use_tls
self.sender = self.email_account.email_id