Django EmailMessage not sending/timeout

django, email

Solution

views.py

from django.core.mail import send_mail

def sending_email(request):
    message = ""
    subject = ""
    send_mail(subject, message, from_email, ['to_email',])

Add this in settings.py

# Sending mail
EMAIL_USE_TLS = True
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT=587
EMAIL_HOST_USER='your gmail account'
EMAIL_HOST_PASSWORD='your gmail password'

Problem

im trying to use django.core.mail to send emails using the default backend and it doesn't seem to be working. I've set up the email credentials, server, and port number in the settings file but whenever I try to run the send() method of an email message the command hangs indefinitely.

Original source