What is the function of the relative pronoun in the adjective clause?

After two years, I met the friend with whom I had exchanged many letters.

A.
possessive

B.
subject

C.
object of a preposition

D.
direct object



Answer :

It's C, object of the preposition. But we usually put the preposition after the verb from the relative clause: "I met the friend whom I had exchanged many letters with" .