From e17d03b376f4c7f1cc33016a911bb21a6b4deeaa Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sat, 3 Jun 2023 22:08:37 +0100 Subject: [PATCH] Actually fix for if cif_data doesn't exist --- src/mailer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mailer.py b/src/mailer.py index 9a311fd..e2fe2b1 100644 --- a/src/mailer.py +++ b/src/mailer.py @@ -57,12 +57,12 @@ def sendMail(msg_body :str): with open(filename, "rb") as attachment: part = MIMEBase("application", "octet-stream") part.set_payload(attachment.read()) - encoders.encode_base64(part) - part.add_header( - "Content-Disposition", - f"attachment; filename= {filename}", - ) - message.attach(part) + encoders.encode_base64(part) + part.add_header( + "Content-Disposition", + f"attachment; filename= {filename}", + ) + message.attach(part) text = message.as_string() context = ssl.create_default_context() try: