mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
SMTP_SKIP_TLS fix
This commit is contained in:
@@ -2394,24 +2394,18 @@ def send_email (pText, pHTML):
|
||||
smtp_connection.ehlo()
|
||||
|
||||
try:
|
||||
if not SafeParseGlobalBool("SMTP_SKIP_TLS"):
|
||||
if not SMTP_SKIP_TLS:
|
||||
smtp_connection.starttls()
|
||||
smtp_connection.ehlo()
|
||||
if not SafeParseGlobalBool("SMTP_SKIP_LOGIN"):
|
||||
if not SMTP_SKIP_LOGIN:
|
||||
smtp_connection.login (SMTP_USER, SMTP_PASS)
|
||||
|
||||
smtp_connection.sendmail (REPORT_FROM, REPORT_TO, msg.as_string())
|
||||
smtp_connection.quit()
|
||||
except smtplib.SMTPAuthenticationError as e:
|
||||
file_print(' ERROR: Couldn\'t connect to the SMTP, skipping Email')
|
||||
file_print(' ERROR: Couldn\'t connect to the SMTP server, skipping Email')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def SafeParseGlobalBool(boolVariable):
|
||||
if boolVariable in globals():
|
||||
return eval(boolVariable)
|
||||
return False
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def send_webhook (_json, _html):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user