From 45e0365931a1da1b9d678f32d68db28154aedd14 Mon Sep 17 00:00:00 2001 From: Chronial Date: Fri, 11 Apr 2014 10:11:18 +0100 Subject: [PATCH] improve error message for not set smtp host --- snapraid-runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snapraid-runner.py b/snapraid-runner.py index a8b2368..8c768b6 100644 --- a/snapraid-runner.py +++ b/snapraid-runner.py @@ -68,6 +68,11 @@ def send_email(success): import smtplib from email.mime.text import MIMEText from email import charset + + if len(config["smtp"]["host"]) == 0: + logging.error("Failed to send email because smtp host is not set") + return + # use quoted-printable instead of the default base64 charset.add_charset("utf-8", charset.SHORTEST, charset.QP) if success: