Translation:I wrote a letter to my mother yesterday.
It is 'To mother'. japanese particle is put after the word. お母さん(mother)+に（particle for mother）, 手紙(letter)+を（particle for letter）.
This is my personal opinion, I think particles resemble prepositions. Though the position is different. (The role of them. They help other word.) Those are so difficult to me.
What do you think? :D
You probably looked at it too quickly. The mother is the intended recipient of the letter not the author. The particle に shows here that she is the indirect object of the verb 書きます, and てがみ is the direct object, indicated by the particle を. Unfortunately, に has many uses besides for the indirect object, and it takes a while to sort these out. They include: direction, location of existence, point in time, purpose, and frequency. There are two more grammatically complicated uses in which に actually does indicate the person doing something (unlike here): in the passive, it indicates the person BY whom or thing BY the means of which something is done, and in the causative, it marks the person made to do something by someone or something else.
Indirect objects without 'to' come between the verb and the direct object, but with 'to,' they come after the direct object. So, 'I wrote my mom a letter ....' is correct, but with 'to' it must be 'I wrote a letter to my mom ....' A number of time or place adverbials can't be put between the verb and it's direct object either. So, for example, we must put 'yesterday' after 'letter' and not before in the given example.