mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-30 21:41:57 -04:00
py3 compat when sending emails with non-ascii content
This commit is contained in:
parent
1d3f6d3dd9
commit
98da158ca6
@ -163,6 +163,8 @@ def get_smtp_class(use_ssl=False, debuglevel=0):
|
||||
def sendmail(msg, from_, to, localhost=None, verbose=0, timeout=None,
|
||||
relay=None, username=None, password=None, encryption='TLS',
|
||||
port=-1, debug_output=None, verify_server_cert=False, cafile=None):
|
||||
if isinstance(msg, str):
|
||||
msg = msg.encode('utf-8')
|
||||
if relay is None:
|
||||
for x in to:
|
||||
return sendmail_direct(from_, x, msg, timeout, localhost, verbose)
|
||||
|
Loading…
x
Reference in New Issue
Block a user