call the gen_email function