mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-02-08 08:14:16 +01:00
Update eMail.py
Using only SMTP via SSL can lead to errors depending on the configuration of the mail server As there is no switch in the config file (which is good so) the approach is to use SSL first and, if this fails, switch to non-SSL connection. Due to the importance of this plugin the pull request is affecting the master-branch.
This commit is contained in:
parent
ec31cfdbc5
commit
8cdfef4bce
|
|
@ -103,7 +103,10 @@ def run(typ,freq,data):
|
|||
#
|
||||
# connect to SMTP-Server
|
||||
#
|
||||
server = smtplib.SMTP_SSL(globalVars.config.get("eMail", "smtp_server"), globalVars.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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue