The degree of influence that the environment and mass have on the stellar populations of early-type galaxies is uncertain. In this paper, we present the results of a spectroscopic analysis of the stellar populations of early-type galaxies aimed at addressing this question. The sample of galaxies is drawn from four clusters, with 〈z〉= 0.04, and their surrounding structure extending to ∼10Rvir. We find that the distributions of the absorption-line strengths and the stellar population parameters, age, metallicity and α-element abundance ratio, do not differ significantly between the clusters and their outskirts, but the tight correlations found between these quantities and the velocity dispersion within the clusters are weaker in their outskirts. All three stellar population parameters of cluster galaxies are positively correlated with the velocity dispersion. Galaxies in clusters form a homogeneous class of objects that have similar distributions of line-strengths and stellar population parameters, and follow similar scaling relations, regardless of the cluster richness or morphology. We estimate the intrinsic scatter of the Gaussian distribution of metallicities to be 0.3 dex, while that of the α-element abundance ratio is 0.07 dex. The e-folding time of the exponential distribution of galaxy ages is estimated to be 900 Myr. The intrinsic scatters of the metallicity and α-element abundance ratio distributions can almost entirely be accounted for by the correlations with the velocity dispersion and the intrinsic scatter about these relations. This implies that the galaxy mass plays a major role in determining its stellar population.