我试图通过管理处理程序发送错误消息,我的settings.py如下:
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'celery' : {
'level' : 'INFO',
'class' : 'django.utils.log.AdminEmailHandler',
},
},
'loggers': {
'celery.webapp.task' : {
'level' : 'INFO',
'handlers' : ['celery'],
'propogate' : False,
},
},
}
ADMINS = (('whoami', 'blab@something.com'))
SERVER_EMAIL = 'blab@something.com'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp1.something.com'
EMAIL_HOST_USER = 'blab@something.com'
EMAIL_PORT = 25
EMAIL_USE_TLS = True
这就是它所要求的地方:
#Logging the counters (Mail)
logger = logging.getLogger('celery.webapp.task')
logger.info("Continue Mapt:" + str(counter_start_mapt))
logger.info("Continue Datt:" + str(counter_start_datt))
logger.info("Continue Sett:" + str(counter_start_sett))
logger.info("Continue Rebuild:" + str(counter_start_sett_rebuild))
使用邮件发送时,我可以发送电子邮件,但是,使用管理邮件处理程序,它不使用email_host,而是使用server_email。有没有办法设置端口,主机服务器电子邮件?