dahyedahye commited on
Commit
76b4277
·
1 Parent(s): dc6f036
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -53,16 +53,21 @@ def send_email_(to_email: str):
53
  msg.attach(MIMEText(body, "plain"))
54
  logging.debug(f"debug 1")
55
 
56
- with smtplib.SMTP(smtp_server, smtp_port) as server:
57
- logging.debug(f"debug 2")
58
- server.starttls()
59
- logging.debug(f"debug 2")
60
- server.login(smtp_user, smtp_password)
61
- logging.debug(f"debug 3")
62
- server.sendmail(smtp_user, to_email, msg.as_string())
63
-
64
- # Log success message
65
- logging.debug(f"Email successfully sent to {to_email}")
 
 
 
 
 
66
 
67
  except Exception as e:
68
  # Log any exceptions that occur during the email sending process
 
53
  msg.attach(MIMEText(body, "plain"))
54
  logging.debug(f"debug 1")
55
 
56
+ server = smtplib.SMTP('smtp.gmail.com', 3000)
57
+ logging.debug(f"#")
58
+ server.ehlo()
59
+ logging.debug(f"#")
60
+
61
+ # with smtplib.SMTP(smtp_server, smtp_port) as server:
62
+ logging.debug(f"debug 2")
63
+ server.starttls()
64
+ logging.debug(f"debug 2")
65
+ server.login(smtp_user, smtp_password)
66
+ logging.debug(f"debug 3")
67
+ server.sendmail(smtp_user, to_email, msg.as_string())
68
+
69
+ # Log success message
70
+ logging.debug(f"Email successfully sent to {to_email}")
71
 
72
  except Exception as e:
73
  # Log any exceptions that occur during the email sending process