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")