Phone "A" is sending the text message; has cell phone service signal and is a valid, active account.
Phone"B" is the receiving phone; no signal and is a valid, active account.
We assume the phones are in their normal "home" cities.
"A" text message ready and addressed to "B".
1) "A" user presses send. The text message is marked to send and the phone finds available cell service radio and bandwidth to send the message. The message is sent to a server at the cell service provider's data center. The server checks the address (phone number) to which the text message is sent. Other network elements are queried for "B"s location.
2) Since "B" is off the air but is a known, active and valid address, the text message is stored in the message server.
3) When "B" is powered up or otherwise back on the air and shows having a radio signal, it registers to the cell phone service provider's network. The message server is alerted to this and sends the text message to "B".
Text messaging is a "store and forward" technology. If "A" had no signal, the message would remain in "A" until it got a signal and was able to send the message to the service provider (go to step 2).