diff --git a/django/core/mail/backends/smtp.py b/django/core/mail/backends/smtp.py index 12cb26c059..63efe438d3 100644 --- a/django/core/mail/backends/smtp.py +++ b/django/core/mail/backends/smtp.py @@ -19,7 +19,10 @@ class EmailBackend(BaseEmailBackend): 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()