This commit is contained in:
parent
a0c556f879
commit
2207f12276
@ -49,8 +49,8 @@ def send_email(
|
|||||||
print(f"Body:\n{body}")
|
print(f"Body:\n{body}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Connect to SMTP server
|
# Connect to SMTP server with timeout
|
||||||
with smtplib.SMTP(settings.smtp_host, settings.smtp_port) as server:
|
with smtplib.SMTP(settings.smtp_host, settings.smtp_port, timeout=10) as server:
|
||||||
server.starttls()
|
server.starttls()
|
||||||
server.login(settings.smtp_username, settings.smtp_password)
|
server.login(settings.smtp_username, settings.smtp_password)
|
||||||
server.send_message(message)
|
server.send_message(message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user