there are sites that offer to send sms for free. How do they do it? how do I send sms programmatically?
The sites that send SMS for free usually use the email interface that most of the carriers implement which allow you to send an email to (for instance) <your 10 digit number>@mobile.att.net
and have it received as an SMS by that phone.
Send an email to the 10 digit phone number @ Carrier's domain name.
Here is a list of the carriers and their domains:
http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_E-Mail_or_Web_to_SMS_Gateways
There are good answers to this Stack Overflow question:
How to send text messages to mobile devices programmatically and on-the-cheap?
It also references several others which are listed below:
Are there any free services for sending SMS programmatically?
Programmatic SMS
Free SMS API?
I use an SMS gateway and it is fairly easy but I did consider this as an alternative because it potentially gave me more control email to sms