From 306129571881ca42ec18f1fa6dc36e852d5eac46 Mon Sep 17 00:00:00 2001 From: salvadorpla Date: Sat, 30 Nov 2019 15:38:52 +0100 Subject: [PATCH] Updated mailing.py --- mailing.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mailing.py b/mailing.py index 1d52a25..4563702 100644 --- a/mailing.py +++ b/mailing.py @@ -316,14 +316,12 @@ try: fp = open('message.txt') text = fp.read() message = MIMEText(text) - + fp.close() + except: print("message.txt file not found! Create it and write in the message you want for your inactive users.") - -finally: - - fp.close() + sys.exit(0) i = 0 while i < len(inactive_email):