Not sure if this is a bug but I doubt it. If an exception occurs after a sendmail tag the mail is still sent. It should probably be part of a transaction.