In the first sentence, you tell the reader when the letter was sent - you state a point in time (i.e. yesterday). The past simple is used in this case.
In the second sentence, no specified time is given for when the letter was sent. For unspecified time, the present perfect is used.
Here 's another sentence:
I've been working here for 6 months.
In this sentence, the writer states the period of time (up to the present) that he has working for the company. The present perfect tense is used when talking about how long an even has taken place(up to the present).
For more on this subject, consult a good grammar book, such as Intermediate Grammar in Use (Cambridge University Press - Raymond Murphy)