Clean up email function