What language? You will need something like PHP or ASP.
Sending SMS messages is actually very easy, it's just email, but you need to know what provider the phone is that you are sending to. To send an SMS message you just email the number @ the providers domain. For example:
Here is a list of SMS domains
for most carriers.