adds code to send email