0

My code works and outputs the email to the console but I don't receive any email in my inbox.

My settings:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'youremail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
EMAIL_PORT = 587
xyres
  • 20,487
  • 3
  • 56
  • 85

2 Answers2

0

Add this in settings.py to print the email on console.

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

Refer: Test sending email without email server

Pranav Aggarwal
  • 605
  • 4
  • 9
0

First, you need to set EMAIL_BACKEND in setting like this.

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

Second, you need to define SMTP credentials details in settings.

For development on localhost, you can run local SMTP server by running following command on terminal.

python -m smtpd -n -c DebuggingServer localhost:1025

For more info Sending email

Shahzad Farukh
  • 317
  • 1
  • 2
  • 17