Quick answer: It is appropriate to use "whom" in formal writing after these words (prepositions):
to, from, with, without, among, for, in, by, on, ... (and all other prepositions)
There are other cases when "whom" is appropriate, but that means a very long answer. See the links suggested for more details.