I have an iPhone 10XR. Recently, I intermittently get and receive text messages. I have tried resetting network settings, opening and closing airplane mode, opening and closing wi-fi and cellular. I have also noted that when I start a text message to someone, it defaults to their email address rather than to their cellphone number from my contacts.
this happens with wi-fi or data connections.