added sendMail function