started work on sendEmail funciton