🔧 Add SMTP_SSL option for older SMTP servers (#365)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Chandler Rosenthal
2024-03-12 08:03:04 -05:00
committed by GitHub
parent a4358db5bc
commit 2f027567c6
3 changed files with 4 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ def send_email(
smtp_options = {"host": settings.SMTP_HOST, "port": settings.SMTP_PORT}
if settings.SMTP_TLS:
smtp_options["tls"] = True
elif settings.SMTP_SSL:
smtp_options["ssl"] = True
if settings.SMTP_USER:
smtp_options["user"] = settings.SMTP_USER
if settings.SMTP_PASSWORD: