I am working on a bulk mailing platform using Django send_mass_mail
function. Everything worked perfectly. But the problem I am facing is, I have nearly 500 recipients, and if one recipient fails to receive mail (recipient side errors like, improper mail address provision), the whole function stops immediately. How to send the next mail, if current data tuple has errors in data. I think the question is straight and need no code examples. Since i followed straight from the Django Docs
According to the docs you could use fail_silently=True
(which is False
by default):
fail_silently
: A boolean. When it’sFalse
,send_mail()
will raise ansmtplib.SMTPException
if an error occurs. See thesmtplib
docs for a list of possible exceptions, all of which are subclasses ofSMTPException
.