Here is how we do it for the moment:
We store the users 10 digit phone number and then also the name of their provider. At&T, Verizon, Sprint, Etc. Then when we need to send a test be combine the phone number + the respective domain.
So sbc global may be something like 4448781111@sbcglobal.net
That is just an example.
You can find many lists on the web for providers and their email addresses.
You then just create a mail message and send the text via email which is covnerted to a txt through the service providers network. Otherwise, I would suggest a third party api that will handle text messages for you via a web api.