Envoyer par SMS: The environment and redshift dependence of accretion onto dark matter halos and subhalos