-
-
Save alexle/1294495 to your computer and use it in GitHub Desktop.
# sms.py | |
# Sends sms message to any cell phone using gmail smtp gateway | |
# Written by Alex Le | |
import smtplib | |
# Use sms gateway provided by mobile carrier: | |
# at&t: [email protected] | |
# t-mobile: [email protected] | |
# verizon: [email protected] | |
# sprint: [email protected] | |
# Establish a secure session with gmail's outgoing SMTP server using your gmail account | |
server = smtplib.SMTP( "smtp.gmail.com", 587 ) | |
server.starttls() | |
server.login( '<gmail_address>', '<gmail_password>' ) | |
# Send text message through SMS gateway of destination number | |
server.sendmail( '<from>', '<number>@tmomail.net', '<msg>' ) |
Is there anyway to recive data back through the same email
Worked for me! Thank you!
@muthukumarece5 I was getting the same error! This is what fixed it for me.
T-Mobile likes it if it is in an email
type format. Here is the T-Mobile help form (https://support.t-mobile.com/thread/141399)
The following code worked for me
import smtplib
server = smtplib.SMTP( "smtp.gmail.com", 587 )
server.starttls()
server.login( '[email protected]', 'xxxxxxxxxx' )
from_mail = '[email protected]'
to = '[email protected]'
body = '<body>'
message = ("From: %s\r\n" % from_mail + "To: %s\r\n" % to + "Subject: %s\r\n" % '' + "\r\n" + body)
server.sendmail(from_mail, to, message)
I tried this method. Google blocked my sign in attempt because the app(smtp, I think) "doesn't meet modern security standards."
Is there a workaround for this?
You have to enable less secure devices in your Google account,
I used this method and It worked great! Is there any way though that I can get the script to respond to a message in the conversation?
For those interested, here is an implementation with multiple carriers + and async support: https://bit.ly/send-txt-msg
Do you guys know how to remove the subject when you send the text? Like the forward slashes? I just get / no subject / when I leave it blank
help