I've overwritten the django EmailBackend to use email credentials that are set in a model so that my clients can use their own address to send email out to their customers. I have written this in smpt.py in the same directory as settings.py, and then call it in the settings.py like this:
EMAIL_BACKEND = 'smtp.MyEmailBackend'
this works and emails are being sent from my client's address.
I also have a default hardcoded set of email settings in settings.py, for sending error logs to myself, using the default django email backend:
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
'email_backend':'django.core.mail.backends.smtp.EmailBackend',
}
},
This also works, and my hardcoded email_host is sending me error emails.
Problem is that my client's email_host is also sending me error reports, and I can't work out why.
Any ideas?