Unless the offer provides otherwise,
(a) an acceptance made in a manner and by a medium invited by an offer is operative and completes the manifestation of mutual assent as soon as put out of the offeree's possession, without regard to whether it ever reaches the offeror; but
(b) an acceptance under an option contract is not operative until received by the offeror.
—Restatement (Second) of Contracts § 63
This is a verbose statement of the "mailbox rule," which governs contract
formation in common law
countries (i.e. most of the Anglosphere
). It gets its common name because, historically, it was intended to clear up the exact point when a contract was formed by mail. Nowadays, it can be applied to other types of communication as well.
Under common law, a contract essentially consists of an offer, some form of consideration, and an acceptance. The contract is formed as soon as the acceptance is made (there are lots of nuances you can get into along the way). If you go into a store and look at the only computer they have left, and the salesman tells you he'll sell it for $1,000, you can agree to the price, and the contract is formed as soon as you make that agreement. The salesman is then bound to give you the computer if you give him the money. However, if someone else walks in while you're thinking about the offer, asks to buy the computer, and whips out their gold card, the salesman can revoke his offer to you, the newcomer can take the computer home, and you can't legally stop either of them once the offer is revoked, because you never agreed to the salesman's terms. That's common sense, and common sense forms the basis of contract law, albeit under a fancy name: the "objective theory of contract formation."
As nice as it is to deal with objective standards, common sense starts getting fuzzy when you're forming a contract through a delayed form of communication, such as the mail. This is where the mailbox rule comes into play.
The rule was established by the King's Bench of England in 1818, in a case involving wool. A wool dealer in St Ives had sent a letter to a factory in Bromsgrove, Worcestershire, offering to sell 800 tods of fleece at thirty-five and a half shillings apiece. They didn't get a reply for six days (a considerable wait, considering the lightning speed of Britain's post at the time). As it turned out, the dealer had mistakenly sent the letter to a town of the same name in a different county: the post noticed this and redirected the letter to its intended recipient, who promptly accepted the offer by return post. By that point, the wool was already sold, so the factory sued.
The King's Bench based its decision, appropriately, on common sense. If a contract was not formed until the acceptance was received, a person would never know that their acceptance was valid unless the offeror told them that it had been received. And since the communication of acceptance, like the communication of offer, could be revoked at any time before the contract was formed, the offeror wouldn't really know if the acceptance was valid even if they had it in their hand. Basing the acceptance on its postmark date, rather than its receipt date, was much more practical than the alternative.
The precedent established by that court lives on today. Since then, the mailbox rule has been extended by different courts to cover telegraphs, e-mail, and other forms of communication. There have been a few briefly successful challenges: in 1949, for instance, a U.S. federal court held that the mailbox rule didn't apply if postmasters were authorized to stop delivery of a letter when contacted by the sender. (Dick v. U.S., 82 F. Supp. 326.) This reasoning was not accepted in other courts and it therefore failed to take hold in American law.
Just remember: once it's sent, it's sent, and you can't take it back without a fight.
This writeup does not constitute legal advice! ESPECIALLY if you're outside the English-speaking world!
For the text of the King's Bench decision, look up Adams v. Lindsell, 106 Eng. Rep. 250 (1818).