Commit ·
76b4277
1
Parent(s): dc6f036
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 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|