Like
@matrix07 said, the phone must be connected to the internet for SMS. iMessage, however, doesn’t require this.
There’s an article
here about different phone connection requirements for different functions. Not sure if this applies to your case, hope it helps.