[Answer]-Why did I only get status code 1 and not a Python error message when I supplied the wrong value to EMAIL_BACKEND?

1πŸ‘

βœ…

The return value you see is the number of messages processed. From the django.core.mail.backends.base.BaseEmailBackend.send_messages() method:

def send_messages(self, email_messages):
    """
    Sends one or more EmailMessage objects and returns the number of email
    messages sent.
    """

The backend you are using, even though it is the wrong one, is indicating it sent 1 message.

If this is the django.core.mail.console.EmailBackend() backend, that just means 1 message was written to sys.stdout, but otherwise not forwarded to a SMTP server.

Leave a comment