|
@@ -512,14 +512,10 @@ elif OPTIONS.download is True:
|
|
|
MAIL_TEXT += line + "\n"
|
|
|
MSG_TEXT = MIMEText(MAIL_TEXT.encode("utf8"), _charset="utf8")
|
|
|
MSG.attach(MSG_TEXT)
|
|
|
- SERVER_CONNECTION = smtplib.SMTP()
|
|
|
+ SERVER_CONNECTION = smtplib.SMTP(CONF.values["mailhost"],
|
|
|
+ CONF.values["smtpport"])
|
|
|
try:
|
|
|
- if sys.version_info >= (3, 0):
|
|
|
- SERVER_CONNECTION.connect(CONF.values["mailhost"],
|
|
|
- CONF.values["smtpport"])
|
|
|
- else:
|
|
|
- SERVER_CONNECTION.connect(str(CONF.values["mailhost"]),
|
|
|
- str(CONF.values["smtpport"]))
|
|
|
+ SERVER_CONNECTION.connect()
|
|
|
except (smtplib.SMTPConnectError, smtplib.SMTPServerDisconnected,
|
|
|
socket.error):
|
|
|
LOGGER.error(_("Could not connect to the smtp server, please check"
|