Closed rkrishnasanka closed 1 year ago
@rkrishnasanka it looks like you're trying to call Django's send_mail()
function directly from your settings.py file. That won't work—the Django settings file should contain only settings, never calls to to Django framework functions.
If you're just trying to test that send_mail()
works with your Anymail settings, move the call to some module where Django framework code is allowed and that is always loaded—like apps.py or urls.py. Or you could try Django's built-in interactive shell.
(Calling send_mail()
from settings.py ends up trying to use Django's default SMTP email backend, rather than Anymail, because Django has not finished loading its settings at that point. The error you're seeing is because your system is not configured for sending mail through SMTP.)
Ah I see, I in that case I'm guessing that it should be flagged as an issue on Django for not making this a better handling of the error / print out a better error message.
Thanks for the help !
Reporting an error? It's helpful to know: