Adding code for sending out emails