Spaces:
Build error
Build error
Update app.py
Browse files264 unmodified lines265266267268269270271264 unmodified lines# Attach the instance 'part' to instance 'msg'msg.attach(part)server = smtplib.SMTP('smtp.gmail.com', 587)server.starttls()server.login(sender_email, sender_password)264 unmodified lines265266267268269270271272273274275276277278279280281264 unmodified lines# Attach the instance 'part' to instance 'msg'msg.attach(part)# Set up the SSL contextcontext = ssl.create_default_context()# Send the emailtry:with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=context) as server:server.login(sender_email, sender_password)server.sendmail(sender_email, recipient_email, msg)print("Email sent successfully")except Exception as e:print(f"Error occurred: {str(e)}")server = smtplib.SMTP('smtp.gmail.com', 587)server.starttls()server.login(sender_email, sender_password)
app.py+10