Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #11849 -- Corrected handling of use_tls in the SMTP mail handle…

…r. Thanks to aromano for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 77b602a4ab55a655a0a50dbd8fe130f0952848c4 1 parent f9ead3f
@freakboy3742 freakboy3742 authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/core/mail/backends/smtp.py
View
5 django/core/mail/backends/smtp.py
@@ -19,7 +19,10 @@ def __init__(self, host=None, port=None, username=None, password=None,
self.port = port or settings.EMAIL_PORT
self.username = username or settings.EMAIL_HOST_USER
self.password = password or settings.EMAIL_HOST_PASSWORD
- self.use_tls = (use_tls is not None) and use_tls or settings.EMAIL_USE_TLS
+ if use_tls is None:
+ self.use_tls = settings.EMAIL_USE_TLS
+ else:
+ self.use_tls = use_tls
self.connection = None
self._lock = threading.RLock()
Please sign in to comment.
Something went wrong with that request. Please try again.