Use PHP to send SMS messages to a cell phone from Jabber messages from your instant messenger client.
One of the most useful features of instant messaging is the availability of user presence (knowing whether a user is online). Of course, if a user is unavailable and you really want to get a message to him, it would probably be really cool if you could send the message to his mobile phone.
While many of the latest mobile phones are beginning to support instant messaging, nearly all of them support SMS text messaging. It would be great to send an instant message to a user's cell phone, and this hack shows how to do just that, by using an email-to-SMS gateway (something almost all major phone providers already have in place).
Save the code in Example 9-12 as smsclient.php.
Example 9-12. An SMS client in PHP
<?php /* CONFIG VARIABLES */ // jabber server you are registed at // jabber server you are registed at $SERVER = '
yourserver'; //username and password for your special account $USERNAME = '
yourusername'; $PASSWORD = '
yourpassword'; // jabber id for your personal account $PERSONAL = '
username@yourserver'; //these values may change global $cingular; global $verizon; global $nextel; global $tmobile; global $ATT; $cingular = '@cingularME.com'; $verizon = '@vtext.com'; $nextel = '@messaging.nextel.com'; $tmobile = '@tmomail.com'; $ATT = '@mmode.com'; //store any numbers and their carriers here global $cell; //put any ten digit number ...