Does the writer mean that s/he wrote something addressed to the other (I wrote it to you) or instead of that person (I wrote it for you)?Something the other person was supposed to write...
The way the text is what I understand is the second situation.