The simple anwser is that both are correct and mean the same. In certain contexts, #2 could mean something different: My mother wants to buy a present for Peter (or: buy Peter a present ), but she can't get out anymore, so I am going to buy a present for her. She can wrap it up, and then I'll send it to Peter for her.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.