added email function and email view
added email function and email view