It's not possible to know who sent an anonymous gift to you. That's the whole point of an anonymous gift.
However, if the person sent you a gift anonymously with an abusive message you can simply report the PM you got about the gift and a mod can find out who sent the gift and punish them accordingly.