send sms from gmail using python script

こ雲淡風輕ζ 提交于 2020-01-07 03:00:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!