Last active
June 7, 2017 15:39
-
-
Save AO8/f064befd4647b61cc9c6bb3565ec6a0e to your computer and use it in GitHub Desktop.
Send a text message from Gmail 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
# allow less secure apps to access your Gmail at: https://support.google.com/accounts/answer/6010255?hl=en | |
# https://en.wikipedia.org/wiki/List_of_SMS_gateways | |
# [email protected] for AT&T | |
# [email protected] for Sprint | |
# [email protected] for T-Mobile | |
# [email protected] for Verizon | |
import smtplib | |
username = "[email protected]" | |
password = "your_gmail_password" | |
to_addrs= "[email protected]" | |
server = smtplib.SMTP("smtp.gmail.com:587") | |
server.starttls | |
server.login(username, password) | |
server.sendmail(username, to_addrs, "Enter your text message") | |
server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment