title: send_mail not working in django
body: <p>I wrote this code
  <strong>settings.py</strong></p>
  
  <pre><code>EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  EMAIL_HOST='smtp.gmail.com'
  EMAIL_PORT=587
  EMAIL_HOST_USER = 'myemailhere@gmail.com'
  EMAIL_HOST_PASSWORD = '**********'
  DEFAULT_FROM_EMAIL = 'myemailhere@gmail.com'
  EMAIL_USE_TLS = True
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>def email(request):
      if request.method == 'GET':
          form = ContactForm()
      else:
          form = ContactForm(request.POST)
          if form.is_valid():
              subject = form.cleaned_data['subject']
              from_email = form.cleaned_data['from_email']
              message = form.cleaned_data['message']
              try:
                  send_mail(subject, message, from_email ['myemailhere@gmail.com'])
              except BadHeaderError:
                  return HttpResponse('Invalid header found.')
              return redirect('success')
      return render(request, "email.html", {'form': form})
  
  
  def success(request):
      email = EmailMessage('Hello', 'how are you?', to=['myemailhere@gmail.com'])
      email.send()
      send_mail('Test mail', 'This is a test', 'myemailhere@gmail.com' ['myemailhere@gmail.com'], fail_silently=False)
      return HttpResponse('Success! Thank you for your message.')
  </code></pre>
  
  <p>In success(request), I added a bit of redundant code to try sending mail in a different way just to check if other method is working or not. None of it is working. Can anyone please tell me why? I am a bit confused. Password is correct and i allowed less secured apps for gmail.This program is not throwing any error. Success page is called if email(request) tells that it has sent mail successfully. I am using django 1.11 and Python 2.7
  Thankyou in advance :)</p>