Answer: Last year, when I last met her, she told me she had written a letter every day for the last two months.
Step-by-step explanation:
It is "had written" because the sentence is past tense.
However, it is not "had been writing" because if it was, then the word "letter" would be plural.