From 4ba809b8357e113b8387991c4abd2758fbb2fdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Campion?= Date: Sat, 27 Jan 2024 19:16:53 +0100 Subject: [PATCH] Allow optional usage of the tls encryption for SMTPA For local dev, a local SMTP server like mailhog is useful and allow to manually manage user creation --- litellm/proxy/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 713f117cab..754b8a053a 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -1022,7 +1022,8 @@ async def send_email(sender_name, sender_email, receiver_email, subject, html): print_verbose(f"SMTP Connection Init") # Establish a secure connection with the SMTP server with smtplib.SMTP(smtp_host, smtp_port) as server: - server.starttls() + if os.getenv("SMTP_TLS", 'True') != "False": + server.starttls() # Login to your email account server.login(smtp_username, smtp_password)