Authentication

Nick Vatamaniuc vatamane at gmail.com
Wed Jul 19 01:11:27 EDT 2006


Matheus,
There is libgmail @ http://libgmail.sourceforge.net/
Here is the excerpt from their page.
"""
The following code logs into an account, retrieves a list of threads,
displays information about them and displays the source of the
individual messages.
"""
import libgmail
ga = libgmail.GmailAccount("google at gmail.com", "mymailismypass")
ga.login()
folder = ga.getMessagesByFolder('inbox')
for thread in folder:
  print thread.id, len(thread), thread.subject
  for msg in thread:
    print "  ", msg.id, msg.number, msg.subject
    print msg.source
------------------------------------
I tried it before and it didn't work, it said login failed. Perhaps it
will work for you. Looking at the source is always a GoodThing
(especially if you give your password to a program you just downloaded
as an input...).

Nick Vatamaniuc


bigodines wrote:
> Hello guys,
>
> I'm trying to learn python by making some small programs that could be
> useful for some bigger propouses. In fact, i've made a small "check
> latest-modified" for webpages and it's working great.
>
> The next step I would like to do is to check if I have new e-mails (I
> don't wanna read it from my program, i just wanna it to tells me "yes,
> you have new mail(s)" or "no".
>
> My question is, how do I log into my google account using urllib2 to
> check this? Does anyone have a sample script that I can use or
> something to help me?
> 
> thanks in advice,
> Matheus




More information about the Python-list mailing list