If email is configured, send a mail after replace is complete.
Take both success and failure of a replace into account when sending email.