问题
I am trying to work for sending sms from gmail using python. I have tried many solutions but it didnt worked. I tried to use libgmail but seems to be deprecated. Even I am not able to find how to send sms from gmail to jawwal where as actually gmail sends free sms to jawwal.
My code is:
import libgmail
from TextMessaging import *
sender = Sender(<username>, <password>)
txtM = TextMessage(subject, body)
receiver = Receiver("<phone no>", "Jawwal")
sender.sendMessage(receiver, txtM)
in this, on sender it gives error as expected string or buffer
and for reciever, i dont know whats carrier for jawwal like
CARRIERS = {"Alltel":"alltelmessage.com",
"ATT":"mobile.mycingular.com",
"Rogers":"pcs.rogers.com",
"Sprint":"messaging.sprintpcs.com",
"tMobile":"t-mobile.net",
"Telus":"msg.telus.com",
"Verizon":"vtext.com"}
Kindly give me on any information how to send sms to gmail using python script.
Thanks
回答1:
Perhaps you would want to use one of these services:
[https://www.twilio.com/sms][1]
[http://www.clockworksms.com/][2]
They provide REST API options.
I know this is an old question, but just posting for someone searching for an answer.
回答2:
"As of April 1, 2014, sending SMS messages to phone contacts through Google Chat in Gmail was discontinued for all supported mobile operators."
https://support.google.com/chat/answer/112176?hl=en
回答3:
I think the carrier's email address for your phone is as such:
jawwal.com.country_code
Replace country_code
with the appropriate URL extension (.sa
, .lb
, etc.).
来源:https://stackoverflow.com/questions/8395952/send-sms-from-gmail-using-python-script