Last active
January 1, 2016 18:52
-
-
Save BrandonLMorris/5720de3471eb44b3e2e6 to your computer and use it in GitHub Desktop.
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
#!/usr/bin python3 | |
""" | |
A simple script to send a text message over gmail. Text messages are sent as | |
emails. The mail address depends on the carrier, based on the table below: | |
AT&T: number@txt.att.net | |
T-Mobile: number@tmomail.net | |
Verizon: number@vtext.com | |
Sprint: number@messaging.sprintpcs.com or number@pm.sprint.com | |
Virgin Mobile: number@vmobl.com | |
Tracfone: number@mmst5.tracfone.com | |
Password for the sending email is obtained in secret using getpass module | |
""" | |
import smtplib | |
from getpass import getpass | |
sender = # Your gmail address goes here | |
receiver = # The receiving number/email goes here | |
message = """Stay awesome, my friend""" | |
password = getpass('Enter the password for ' + sender + ': ') | |
# Ship it off | |
s = smtplib.SMTP('smtp.gmail.com', 587) | |
s.starttls() | |
s.login(sender, password) | |
s.sendmail(sender, receiver, message) | |
s.quit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment