The correct option is B whom
A subject of a sentence is the person, place or thing we are talking about. Generally, if we can replace the subject with a subject pronoun (I, you, he, she, it, we, they), the correct choice to refer back to it is by using the relative pronoun who.
An object in a sentence is the person, thing or place who is on the receiving end of the action. If we can replace the object with an object pronoun (me, you, him, her, it, us, them), the correct choice to refer back to it is by using the relative pronoun whom.
Whose (the possessive from of who) is used in speaking of persons, animals and also things without life.
Which is used for things without life and for animals.
Here, Option B is correct. We use 'whom' as we are referring to the object of the preposition in the sentence. We can also write 'She wrote to him.' So, to refer back to 'him', we need to use 'whom'.
Consequently, the other three options cancel out.