Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #1555 -- Added EMAIL_PORT setting. Thanks, bde3

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2665 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8d70ed4b25d65df8fe9f2a783f9f2a87bc7aaea1 1 parent cd7dbd8
Adrian Holovaty adrianholovaty authored
3  django/conf/global_settings.py
View
@@ -89,6 +89,9 @@
# Host for sending e-mail.
EMAIL_HOST = 'localhost'
+# Port for sending e-mail.
+EMAIL_PORT = 25
+
# Optional SMTP authentication information for EMAIL_HOST.
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
2  django/core/mail.py
View
@@ -30,7 +30,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST
If auth_user and auth_password are set, they're used to log in.
"""
try:
- server = smtplib.SMTP(settings.EMAIL_HOST)
+ server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
if auth_user and auth_password:
server.login(auth_user, auth_password)
except:
11 docs/settings.txt
View
@@ -334,6 +334,8 @@ Default: ``'localhost'``
The host to use for sending e-mail.
+See also ``EMAIL_PORT``.
+
EMAIL_HOST_PASSWORD
-------------------
@@ -358,6 +360,15 @@ Django won't attempt authentication.
See also ``EMAIL_HOST_PASSWORD``.
+EMAIL_PORT
+----------
+
+Default: ``25``
+
+**New in Django development version.**
+
+Port to use for the SMTP server defined in ``EMAIL_HOST``.
+
EMAIL_SUBJECT_PREFIX
--------------------
Please sign in to comment.
Something went wrong with that request. Please try again.