I have done that some time ago, so many things can be changed. Basically you communicate tith you phone over the AT commands, sending the ASCI command string proper for your phone (see phone manual). As an anwer you will get the string with your SMS message.
cheers
Pawel