Merge pull request #13484 from frappe/mergify/bp/develop/pr-13314
fix: encode error to add outgoing mail to sent folder
This commit is contained in:
commit
b4f4e48bd6
1 changed files with 3 additions and 3 deletions
|
|
@ -10,7 +10,7 @@ import functools
|
|||
|
||||
import email.utils
|
||||
|
||||
from frappe import _, are_emails_muted
|
||||
from frappe import _, are_emails_muted, safe_encode
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import (validate_email_address, cint, cstr, get_datetime,
|
||||
DATE_FORMAT, strip, comma_or, sanitize_html, add_days, parse_addr)
|
||||
|
|
@ -608,7 +608,6 @@ class EmailAccount(Document):
|
|||
|
||||
|
||||
def append_email_to_sent_folder(self, message):
|
||||
|
||||
email_server = None
|
||||
try:
|
||||
email_server = self.get_incoming_server(in_receive=True)
|
||||
|
|
@ -622,7 +621,8 @@ class EmailAccount(Document):
|
|||
|
||||
if email_server.imap:
|
||||
try:
|
||||
email_server.imap.append("Sent", "\\Seen", imaplib.Time2Internaldate(time.time()), message.encode())
|
||||
message = safe_encode(message)
|
||||
email_server.imap.append("Sent", "\\Seen", imaplib.Time2Internaldate(time.time()), message)
|
||||
except Exception:
|
||||
frappe.log_error()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue