Django not sending emails to admins

后端 未结 20 1168
梦如初夏
梦如初夏 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条回答
  •  旧时难觅i
    2020-12-08 09:39

    The below info is given in https://docs.djangoproject.com/en/2.1/howto/error-reporting/#email-reports

    EMAIL_HOST = "email host"
    
    EMAIL_HOST_USER = "Email username"
    
    EMAIL_HOST_PASSWORD = "Email Password"
    
    DEBUG = False
    
    ADMINS = (
        ("Your Name", "your_email@company.com")
    )
    

    In order to send email, Django requires a few settings telling it how to connect to your mail server. At the very least, you’ll need to specify EMAIL_HOST and possibly EMAIL_HOST_USER and EMAIL_HOST_PASSWORD, though other settings may be also required depending on your mail server’s configuration. Consult the Django settings documentation for a full list of email-related settings.

提交回复
热议问题