email function to be tested