How is the underlined pronoun used in the sentence?

A while ago, he gave (me) a rookie basketball card as a birthday gift.

A.
subject

B.
direct object

C.
object of preposition

D.
indirect object