The context refers to an action that has already been completed in the past. This is simple past tense.
Option B "I wrote to them" is the correct answer as it mentions that the action has already been completed twice last month.
"I'd written to them" is in past perfect tense and indicates an event that took place before another event took place. This does not concur with the context.
"I've written to them" is incorrect as it is in present perfect tense.
"I would have written to them" is incorrect as it indicates a preference.
Thus, option B is correct.