Django send_mail not working
Adjust your settings thus:
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'P@ssw0rd5'
Adjust your code:
from django.core.mail import EmailMessage
def send_email(request):
msg = EmailMessage('Request Callback',
'Here is the message.', to=['[email protected]'])
msg.send()
return HttpResponseRedirect('/')