title: Sending email using Outlook SMTP
body: <p>I want to send email in Django application using Outlook's SMTP server. The problem is, I get <strong>SSL wrong version number</strong> error every time I'm trying to send a message.</p>
  
  <p>Error traceback:</p>
  
  <pre><code>Traceback (most recent call last):
  File "F:\Development\Python\lib\smtplib.py", line 366, in getreply
      line = self.file.readline()
  File "F:\Development\Python\lib\socket.py", line 297, in readinto
      return self._sock.recv_into(b)
  File "F:\Development\Python\lib\ssl.py", line 453, in recv_into
      return self.read(nbytes, buffer)
  File "F:\Development\Python\lib\ssl.py", line 327, in read
      v = self._sslobj.read(len, buffer)
  ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1450)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File "F:\Development\Python\lib\site-packages\django\core\handlers\base.py", line 115,   in get_response
      response = callback(request, *callback_args, **callback_kwargs)
  File "E:\SkyDrive\Repositories\web\skyproject\views.py", line 13, in index
      email.send()
  File "F:\Development\Python\lib\site-packages\django\core\mail\message.py", line 255, in send
      return self.get_connection(fail_silently).send_messages([self])
  File "F:\Development\Python\lib\site-packages\django\core\mail\backends\smtp.py", line 88, in send_messages
      new_conn_created = self.open()
  File "F:\Development\Python\lib\site-packages\django\core\mail\backends\smtp.py", line 55, in open
      self.connection.login(self.username, self.password)
  File "F:\Development\Python\lib\smtplib.py", line 621, in login
      AUTH_PLAIN + " " + encode_plain(user, password))
  File "F:\Development\Python\lib\smtplib.py", line 398, in docmd
      return self.getreply()
  File "F:\Development\Python\lib\smtplib.py", line 370, in getreply
  + str(e))
  
  smtplib.SMTPServerDisconnected: Connection unexpectedly closed: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1450)
  </code></pre>
  
  <p>This is my SMTP configuration in 'settings.py':</p>
  
  <pre><code>EMAIL_USE_TLS = True
  EMAIL_HOST = 'smtp.live.com'
  EMAIL_HOST_USER = 'my_email@outlook.com'
  EMAIL_HOST_PASSWORD = 'my_password'
  EMAIL_PORT = 587
  </code></pre>
  
  <p>And this is how messages being sent:</p>
  
  <pre><code>from django.core.mail import EmailMessage
  email = EmailMessage('Test', 'Test', to=['email_address@example.com'])
  email.send()
  </code></pre>
  
  <p>I have no idea why I get this error. As far as I know, there are no SSL_VERSION parameter in Django settings.</p>
  
  <p>If it is important, my interpreter's version is <strong>3.3.2</strong>, and Django's version is <strong>1.5.2</strong>.</p>