diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-21 19:33:28 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-21 19:33:28 +0100 |
commit | a059e00533bb4e6ee8955e1c906ccd71115c014c (patch) | |
tree | a3e960afffe82cb0765254bf851dea9d20eea838 /source/utils.py | |
parent | Update revesion date for feedgetter.py. (diff) | |
download | newspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.tar.gz newspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.tar.bz2 newspipe-a059e00533bb4e6ee8955e1c906ccd71115c014c.zip |
Test if the article is present in the database before sending it via mail.
Diffstat (limited to 'source/utils.py')
-rwxr-xr-x | source/utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/utils.py b/source/utils.py index 4ceb3026..f2756286 100755 --- a/source/utils.py +++ b/source/utils.py @@ -168,8 +168,12 @@ def send_mail(mfrom, mto, feed_title, article_title, description): msg.attach(part2) # Send the message via local SMTP server. - s = smtplib.SMTP(conf.smtp_server) - s.login(conf.username, conf.password) + try: + s = smtplib.SMTP(conf.smtp_server) + s.login(conf.username, conf.password) + except: + print("smtp error") + return # 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()) |