SMS messages are nothing more then a short email. The problem is converting them to the correct provider. If you have people set theirs up correctly such as email@example.com then you can just email it to the phone. Or even ask them their number and their provider so that you can create the message. But remember they have to be under 150 chars in general.
Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.