Created
May 5, 2011 15:51
-
-
Save alexle/957293 to your computer and use it in GitHub Desktop.
Send SMS text message with python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
# Use sms gateway provided by mobile carrier: | |
# at&t: [email protected] | |
# t-mobile: [email protected] | |
# verizon: [email protected] | |
# sprint: [email protected] | |
server = smtplib.SMTP( "smtp.gmail.com", 587 ) | |
server.ehlo() | |
server.starttls() | |
server.ehlo() | |
server.login( '<gmail_address>', '<gmail_password>' ) | |
server.sendmail( '<from>', '<number>@tmomail.net', 'Hello!' ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note: gmail may block your sign in attempt since this is considered "less secure" by google. You can enable access for less secure apps in your account settings (see link below). So if line 13 throws an error, go to the link and read what you have to do. Then it should work.
https://support.google.com/accounts/answer/6010255