Search code examples
djangoemailsend

How Email Sent In Django


I have setting.py

# Email settings
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'pass'
EMAIL_PORT = 587

and email method is in admin.py

send_mail(
            'Subject here',
            'Here is the message.',
            '[email protected]',
            ['[email protected]'],
            fail_silently=False,
        )

but it gives error SMTP AUTH extension not supported by server. How I solve this, working on localhost


Solution

  • It Works on port 465 and email ssl true

    EMAIL_PORT = 465
    EMAIL_USE_SSL = True