finished email function