Generally speaking, you cannot specifically ask a non-Jew to do melacha for you on Shabbat even prior to Shabbat (Aruch HaShulchan 243:4). However, in this case there are mitigating circumstances that could make it permitted.
And a couple of them are:
When sending mail, you are instructing the post office manager, who instructs an employee to deliver the mail. This is amira lamira and the Chatam Sofer holds that if done on Friday there is room to be lenient. (See Mishna Berura 307:24 who brings up this concept).
In many cases, the post office worker may not be doing any additional melacha, or it is reasonable that the post office can complete the task efficiently without doing additional melacha. (A candle for 1 is a candle for 100)
See the Shmirat Shabbat kHilchata Chapter 31 for a more thorough discussion.