0

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

5
  • Post your existing code, please. Commented Dec 6, 2011 at 6:05
  • I am trying to use TextMessaging from gmail but which has already error. Commented Dec 6, 2011 at 6:21
  • Could you post your code? I don't feel like writing a whole program. If you want help, could you help us help you? Commented Dec 6, 2011 at 6:23
  • @Blender : i have posted code Commented Dec 6, 2011 at 6:29
  • on sender it gives error as expected string or buffer and for reciever, i dont know whats carrier for jawwal like Commented Dec 6, 2011 at 6:33

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

"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

Comments

0

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.).

3 Comments

yes tried as jawwal.com.ps, jawwal.ps, noone of worked. Also TextMessaging also have the error. is there any another way of sending sms from gmail? gmail is already facilating sending smss that way. i just want to use them in python script.
yes. it says as module object is not callable after username and pwd of gmail
libgmail hasn't been maintained in quite some time and deprecated. so its not working as gmailsms also uses the libgmail

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.