[Django]-Django mail sending error with DEBUG=False

-2👍

First, when DEBUG is True the email was sent, is the email was sent by SMTP server or it just print the email in the console? Are you also using the SMTP emailbackend for your EMAIL_BACKEND settings or you are using the console.backend for your development settings? Because usually you should set your Email_backend to console.backend when you are in development mood.
Second, when you switch to production mood, the application won’t send mail, Did you get any errors? And did you test the google smtp server connection works?(check this for detail: https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend) Sometimes you have to set the ssl_certfile and ssl_keyfile for the google smtp server depends on your google smtp security level.

Leave a comment