Added function for mail alerts