Sending an SMS using Python on the Raspberry Pi is as easy as, well you know, pie.
Python 2.7 will already have the smtplib as well as sys installed, so no extras are required.
Simply replace the phone number,carrier,gmail userid as well as gmail password with your own values and it should run.
You can remove the ‘print’ statements from before the mailserver.ehlo, starttls and ehlo methods. They are there just to give you some feedback just in case sending doesn’t work.
My example lists txt.bellmobility.ca as carrier. Yours likely will be different. You can get a list of carriers here.
I am not sure if gmail processes these SMS messages for any carrier outside North America.
Naturally, your recipients won’t be able to respond to your message, so it really should be used to send one way messages only. Such as when you are 5,000 km away on vacation and your homebrew alarm system sends you a message that someone just broke into your front door and absconded with your brand new 60” LED flat panel TV. It is always better to be informed.