implementing email controller