added email features and functional testing