Actually fix for if cif_data doesn't exist
This commit is contained in:
parent
35faea7ecd
commit
e17d03b376
@ -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:
|
||||||
|
Reference in New Issue
Block a user