diff options
author | Mads Kiilerich <madski@unity3d.com> | 2013-01-02 13:56:34 +0100 |
---|---|---|
committer | Mads Kiilerich <madski@unity3d.com> | 2013-01-02 13:56:34 +0100 |
commit | c1089dc25c943618e723bf58f598d9bff90637b8 (patch) | |
tree | 244707213b86fc7abbf72c74d05e2f5628409dd5 | |
parent | f9e7925c26b4a1771cac978bb3a19bc12abe079e (diff) |
email: fail nicely when no SMTP server has been configured
--HG--
branch : beta
-rw-r--r-- | rhodecode/lib/celerylib/tasks.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py index 0e601e15..0a72f0f0 100644 --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -347,6 +347,10 @@ def send_email(recipients, subject, body, html_body=''): debug = str2bool(config.get('debug')) smtp_auth = email_config.get('smtp_auth') + if not mail_server: + log.error("SMTP mail server not configured - cannot send mail") + return False + try: m = SmtpMailer(mail_from, user, passwd, mail_server, smtp_auth, mail_port, ssl, tls, debug=debug) |