FIX email_smtp.py: smtp_timeout was undefined in scope of send_mail

This commit is contained in:
loberer
2023-12-15 13:26:33 +01:00
parent 9dd3a0a2d1
commit 0f86b05ce5

View File

@@ -109,12 +109,12 @@ def send(pHTML, pText):
if get_setting_value("LOG_LEVEL") == 'debug': if get_setting_value("LOG_LEVEL") == 'debug':
send_email(msg) send_email(msg,smtp_timeout)
else: else:
try: try:
send_email(msg) send_email(msg,smtp_timeout)
except smtplib.SMTPAuthenticationError as e: except smtplib.SMTPAuthenticationError as e:
mylog('none', [' ERROR: Couldn\'t connect to the SMTP server (SMTPAuthenticationError)']) mylog('none', [' ERROR: Couldn\'t connect to the SMTP server (SMTPAuthenticationError)'])
@@ -132,7 +132,7 @@ def send(pHTML, pText):
mylog('none', [' ERROR: ', str(e)]) mylog('none', [' ERROR: ', str(e)])
# ---------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------
def send_email(msg): def send_email(msg,smtp_timeout):
# Send mail # Send mail
if get_setting_value('SMTP_FORCE_SSL'): if get_setting_value('SMTP_FORCE_SSL'):
mylog('debug', ['SMTP_FORCE_SSL == True so using .SMTP_SSL()']) mylog('debug', ['SMTP_FORCE_SSL == True so using .SMTP_SSL()'])