sendEmail func built but still bugs present