Skip to content

Commit

Permalink
improve error message for not set smtp host
Browse files Browse the repository at this point in the history
  • Loading branch information
Chronial committed Apr 11, 2014
1 parent 85dc699 commit 45e0365
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions snapraid-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45e0365

Please sign in to comment.