Lui is the indirect object for both -- il and elle. Strictly speaking, from this sentence you can't tell whether the he sent the 2000 flowers to him or her.
Anne, je lui ai envoyé des roses.
Marc, je lui ai envoyé des roses.
As indirect object, lui serves both genders. As stress pronoun, however, it only applies to the male gender:
Je pense à elle.
Je pense à lui.