Redmind commited on
Commit
9364537
·
verified ·
1 Parent(s): c6d1e3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -300,9 +300,12 @@ def send_email_with_attachment(recipient_email, subject, body, image_data):
300
 
301
  # Create SMTP session for sending the mail
302
  print(body)
303
- server = smtplib.SMTP('smtp.gmail.com', 587)
304
- server.starttls()
305
- server.login(sender_email, sender_password)
 
 
 
306
  print(body)
307
  text = msg.as_string()
308
  print(body)
 
300
 
301
  # Create SMTP session for sending the mail
302
  print(body)
303
+ with smtplib.SMTP_SSL('smtp.gmail.com', 25) as smtp_server:
304
+
305
+ smtp_server.login(sender, password)
306
+ #server = smtplib.SMTP('smtp.gmail.com', 587)
307
+ #server.starttls()
308
+ #server.login(sender_email, sender_password)
309
  print(body)
310
  text = msg.as_string()
311
  print(body)