Recently I wrote this little script to send a text message to my phone using my Gmail account. It uses a python library called libgmail. (Debian / Ubuntu package: python-libgmail should do the trick).
My cell carrier is Alltel — you’ll have to change myCellEmail to match that of your carrier (list provided courtesy of wikipedia).
#!/usr/bin/env python
import libgmail
stuff = libgmail.GmailAccount(“me@gmail.com”, “password”)
myCellEmail = “1234567890@message.alltel.net”
stuff.login()
msg=libgmail.GmailComposedMessage(myCellEmail, “”, “Hello World! From python-libgmail!”)
stuff.sendMessage(msg)
Cheers!