Actually fix for if cif_data doesn't exist

This commit is contained in:
Fred Boniface 2023-06-03 22:08:37 +01:00
parent 35faea7ecd
commit e17d03b376

View File

@ -57,12 +57,12 @@ def sendMail(msg_body :str):
with open(filename, "rb") as attachment: with open(filename, "rb") as attachment:
part = MIMEBase("application", "octet-stream") part = MIMEBase("application", "octet-stream")
part.set_payload(attachment.read()) part.set_payload(attachment.read())
encoders.encode_base64(part) encoders.encode_base64(part)
part.add_header( part.add_header(
"Content-Disposition", "Content-Disposition",
f"attachment; filename= {filename}", f"attachment; filename= {filename}",
) )
message.attach(part) message.attach(part)
text = message.as_string() text = message.as_string()
context = ssl.create_default_context() context = ssl.create_default_context()
try: try: