I'm having trouble sending emails on Django using SMTP. Even after trying various tutorials and checking the documentation, nothing seems to work

36 views Asked by At

Here are the possible things that may cause my problem.

  • using django's live server instead of a domain.

I know in gmail you can't no longer use less secure apps. I enabled two factor authentication and created an app with a unique password. This is what i used for the EMAIL_HOST_PASSWORD.

For gmail I used this in my settings.py file

DEBUG = True
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "smtp.gmail.com"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = "my email address"
EMAIL_HOST_PASSWORD = "my app password"
DEFAULT_FROM_EMAIL = "my email address"

Then tried outlook with the same config except for

EMAIL_HOST = "smtp-mail.outlook.com"
EMAIL_HOST_USER = "outlook email address"
EMAIL_HOST_PASSWORD = "outlook email address password"
DEFAULT_FROM_EMAIL = "outlook email address"

i never had a single success with any of them as I couldn't send out a single mail. Checked my spam folder, inbox folder and all mail folder of the mail recipient.

0

There are 0 answers