The spread of infection in a community stratified into classes, where individuals have a preference for either within- or between-class contact, is discussed. The effect of such classification is assessed through the comparison of heterogeneous epidemic models with corresponding homogeneous models. Stratification of the community is modeled via a multitype branching process approximation to the epidemic. This allows us to conveniently study its effect through such quantities as the epidemic threshold parameter and the probability of a major outbreak. Attention is focused on the model of May and Anderson; however, a number of other heterogeneous structures reflecting preferential mixing are also studied.