I have an SSIS package that sends mails for each record within a Foreach Loop Container. After the e-mail is sent, I add some text to a variable (within a Script Task) saying "Mail sent to customer1@domain.com".
However, I would also like to log when the e-mail fails. I added another script task after the Send Mail Task and changed the constraint to "Failure". I then changed one of the e-mail addresses to an invalid format (like "abc"). When I run it, it fails on the Send Mail Task, but does not go through my Script Task that has the Failure constraint. In other words, the whole package stops because of this failure. I have tried messing around with the FailPackageOnFailure and FailParentOnFailure properties, but I still can't get this to work.
Is there a better way to handle this? I thought my method was pretty simple, but this is not the expected behaviour (for me, anyway).
I would greatly appreciate any suggestions or comments. Thank you!