used success and failure page when sending emails