i’m new to python , and trying to write a script in order to send SMS’s ,
after quick googling i found this lib: libgmail, and successfully installed it ,
this is the code i use to send SMS:
!/usr/bin/env python
import libgmail
ga = libgmail.GmailAccount(“username@gmail.com”, “password”)
myCellEmail = “phonenumber@message.carrier.end”
ga.login()
msg=libgmail.GmailComposedMessage(myCellEmail, “”, “Hello World! From python-libgmail!”)
ga.sendMessage(msg)
i get the following error when trying to run it:
Traceback (most recent call last):
File “C:\Users\Amit\Desktop\SMS\sms.py”, line 14, in
ga.login()
File “C:\Python27\lib\site-packages\libgmail.py”, line 305, in login
pageData = self._retrievePage(req)
File “C:\Python27\lib\site-packages\libgmail.py”, line 340, in _retrievePage
req = ClientCookie.Request(urlOrRequest)
File “build\bdist.win32\egg\mechanize_request.py”, line 31, in init
File “build\bdist.win32\egg\mechanize_rfc3986.py”, line 62, in is_clean_uri
TypeError: expected string or buffer
if you have any ideas , please share ..
thanks a lot
amitos80
As far as I know libgmail is not compatible with the current Gmail interface. If I am not mistaken libgmail is not actively maintained either. You might want to look at alternative options.