From 1ff297bbd661cc86eddf7547cecf6975745ff906 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 22 Jan 2013 21:50:53 +0100 Subject: improvement of send_mail() function. --- source/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/utils.py b/source/utils.py index 577304db..24d6c538 100755 --- a/source/utils.py +++ b/source/utils.py @@ -171,13 +171,13 @@ def send_mail(mfrom, mto, feed_title, article_title, description): try: s = smtplib.SMTP(conf.smtp_server) s.login(conf.username, conf.password) + except Exception as e: + print(e) + else: # sendmail function takes 3 arguments: sender's address, recipient's address # and message to send - here it is sent as one string. s.sendmail(mfrom, mto, msg.as_string()) s.quit() - except Exception as e: - print(e) - return def add_feed(feed_url): """ -- cgit