From 8724cc64fe9932759ea81f885ebc69d12b4b3170 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 25 Jan 2017 22:03:04 +0100 Subject: [PATCH] Update eMail.py Adapting to master-branch (#200) --- plugins/eMail/eMail.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/eMail/eMail.py b/plugins/eMail/eMail.py index 1a4d26b..b639f3c 100644 --- a/plugins/eMail/eMail.py +++ b/plugins/eMail/eMail.py @@ -103,12 +103,15 @@ def run(typ,freq,data): # # connect to SMTP-Server # - server = smtplib.SMTP_SSL(globals.config.get("eMail", "smtp_server"), globals.config.get("eMail", "smtp_port")) + try: + server = smtplib.SMTP_SSL(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) + except: + server = smtplib.SMTP(globalVars.config.get("eMail", "smtp_server"), globalVars.config.get("eMail", "smtp_port")) # debug-level to shell (0=no debug|1) server.set_debuglevel(0) # if tls is enabled, starttls - if globalVars.config.get("eMail", "tls"): + if globalVars.config.getboolean("eMail", "tls"): server.starttls() # if user is given, login @@ -184,7 +187,7 @@ def run(typ,freq,data): return else: - logging.warning("Invalid Typ: %s", typ) + logging.warning("Invalid Type: %s", typ) finally: logging.debug("close eMail-Connection")