Implemented email functionality