diff --git a/docs/subsystems/email.md b/docs/subsystems/email.md index 49a27e8b50..f5a4d6cbc3 100644 --- a/docs/subsystems/email.md +++ b/docs/subsystems/email.md @@ -65,7 +65,8 @@ account** in `/emails` page. This feature can be used for testing how emails gets rendered by different email clients. Before enabling this you have to first configure the following SMTP settings. -* The hostname `EMAIL_HOST` in `zproject/dev_settings.py` +* The hostname `EMAIL_HOST` in `zproject/dev_settings.py`. +* The port `EMAIL_PORT` in `zproject/dev_settings.py`. * The username `EMAIL_HOST_USER` in `zproject/dev_settings.py`. * The password `email_password` in `zproject/dev-secrets.conf`. diff --git a/zproject/dev_settings.py b/zproject/dev_settings.py index 1c61dfb5d6..7d53bda1a6 100644 --- a/zproject/dev_settings.py +++ b/zproject/dev_settings.py @@ -89,6 +89,7 @@ PASSWORD_MIN_GUESSES = 0 # SMTP settings for forwarding emails sent in development # environment to an email account. EMAIL_HOST = "" +EMAIL_PORT = 25 EMAIL_HOST_USER = "" # Two factor authentication: Use the fake backend for development. diff --git a/zproject/email_backends.py b/zproject/email_backends.py index 86ae7de2ff..fca554deee 100644 --- a/zproject/email_backends.py +++ b/zproject/email_backends.py @@ -52,7 +52,7 @@ class EmailLogBackEnd(BaseEmailBackend): msg.add_alternative(text, subtype="plain") msg.add_alternative(html, subtype="html") - smtp = smtplib.SMTP(settings.EMAIL_HOST) + smtp = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT) smtp.starttls() smtp.login(settings.EMAIL_HOST_USER, settings.EMAIL_HOST_PASSWORD) smtp.send_message(msg)