I created a view for email that worked for sometime but recently stopped sending mails. However I can see the mail in the console. I don't know what is wrong.
I have used both send_email and Emailmessage but none of them work.
views.py
def mail(request):
msg = EmailMessage('Request Callback',
'Here is the message.', to=['****@gmail.com'])
msg.send()
return HttpResponseRedirect('/')
settings.py
DEFAULT_FROM_EMAIL = '****@gmail.com'
SERVER_EMAIL = '****@gmail.com'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '****@gmail.com'
EMAIL_HOST_PASSWORD = '***********'