for(//all items in the list)
{
try
{
//send email
//insert in db
}
catch (Exception e)
{
//log the error for futher reference ( or error correction mechanism )
//for exmaple if an email is not sent it should be loged to be retried or recovered in future
// or if something is not inserted it should be logged to be retried or recovered in future
continue;
}
}
ps: I think in your scenario
sending email and
inserting something in db should be performed in one shot, so it would be better if you consider a transaction for both of them.