In Drosophila melanogaster, mating radically transforms female physiology and behaviour. Post-mating responses include an increase in the oviposition rate, a reduction in female receptivity and an activation of the immune system. The fitness consequences of mating are similarly dramatic--females must mate once in order to produce fertile eggs, but additional matings have a clear negative effect. Previously, microarrays have been used to examine gene expression of females differing in their reproductive status with the aim of identifying genes influenced by mating. However, as only virgin and single mated females were compared, transcriptional changes associated with reproduction (under natural selection) and male-induced effects (possibly under sexually antagonistic selection) cannot be disentangled. We partitioned these fundamentally different effects by instead examining the expression profiles of virgin, single mated and double mated females. We found substantial effects relating to reproduction and further effects that are only attributable to mating itself. Immune response genes dominate this male-induced effect indicating that the cost of mating may be due partly to this system's activation. We propose that both sexually antagonistic and natural selection have been important in the evolution of the innate immunity genes, thereby contributing to the sexual dimorphism and rapid evolution at these loci.