adding error and success message when mail is sent