It’s a nifty little trick that can come in handy. In my case, I use it to notify me if my webserver suddenly becomes unavailable for some reason. It uses the fact that most cell phones can be texted via email by using a certain adress, such as The code I use:

def send_text(str):

HOST = ""

SUBJECT = "Server offline!"
TO = ""

FROM = ""

text = str
BODY = string.join(("From: %s" % FROM, "To: %s" % TO, "Subject: %s" % SUBJECT, "", text), "\r\n")

s = smtplib.SMTP('',587)




s.login("", "mypassword")

s.sendmail(FROM, [TO], BODY)


Leave a Reply

Your email address will not be published. Required fields are marked *