One species of fungus (split-gill mushroom, Schizophyllum commune) has over 20,000 distinct sexes. Its spores can fertilize any of the other sexes - guaranteeing, basically, that it CAN mate with any spore NOT from its own parent.
Some plants do this by activating the male and female parts of their flowers at different times, but this strategy is way stronger.