I had the same problem when trying to send via smtp.gmail.com using use_tls = True. Turns out I had the wrong set of ports. Here is what I am doing now and it works:
from django.core.mail import get_connection
from django.core.mail.message import EmailMessage
connection = get_connection(use_tls=True, host='smtp.gmail.com', port=587,username='YourEmail@gmail.com', password='YourPassword')
EmailMessage('test', 'test', 'addr@from.com', ['addr@to.com'], connection=connection).send()
source
share