Spaces:
Build error
Build error
Update app.py
Browse files251 unmodified lines25225325425525625725821 unmodified lines2802812822832842852867 unmodified lines2942952962972982993004 unmodified lines305306307308309310311251 unmodified linesprint(recipient_email)print(subject)print(body)print(image_data)sender_email = os.getenv("EMAIL_SENDER")sender_password = os.getenv("EMAIL_PASSWORD")21 unmodified linespart.add_header('Content-Disposition', f"attachment; filename= {attachment_path}")# Attach the instance 'part' to instance 'msg'msg.attach(part)"""# Create a MIMEBase instance for the attachmentpart = MIMEBase('application', 'octet-stream')7 unmodified linespart.add_header('Content-Disposition', 'attachment; filename="image.png"')# Attach the instance 'part' to the instance 'msg'msg.attach(part)# Create SMTP session for sending the mailserver = smtplib.SMTP('smtp.gmail.com', 587)4 unmodified linesserver.quit()except Exception as error:print(error)# return 1251 unmodified lines25225325425525625725821 unmodified lines2802812822832842852867 unmodified lines2942952962972982993004 unmodified lines305306307308309310311251 unmodified linesprint(recipient_email)print(subject)print(body)#print(image_data)sender_email = os.getenv("EMAIL_SENDER")sender_password = os.getenv("EMAIL_PASSWORD")21 unmodified linespart.add_header('Content-Disposition', f"attachment; filename= {attachment_path}")# Attach the instance 'part' to instance 'msg'msg.attach(part)# Create a MIMEBase instance for the attachmentpart = MIMEBase('application', 'octet-stream')7 unmodified linespart.add_header('Content-Disposition', 'attachment; filename="image.png"')# Attach the instance 'part' to the instance 'msg'msg.attach(part)"""# Create SMTP session for sending the mailserver = smtplib.SMTP('smtp.gmail.com', 587)4 unmodified linesserver.quit()except Exception as error:print(f"An error occurred: {error}")# return 1
app.py+4-4