Django not sending emails to admins

后端 未结 20 1178
梦如初夏
梦如初夏 2020-12-08 08:54

According to the documentation, if DEBUG is set to False and something is provided under the ADMINS setting, Django will send an email

20条回答
  •  没有蜡笔的小新
    2020-12-08 09:33

    In my case the cause was missing SERVER_EMAIL setting.

    The default for SERVER_EMAIL is root@localhost. But many of email servers including my email provider do not accept emails from such suspicious addresses. They silently drop the emails.

    Changing the sender email address to django@my-domain.com solved the problem. In settings.py:

    SERVER_EMAIL = 'django@my-domain.com'
    

提交回复
热议问题