Solved

Email contacts grabber library?

Posted on 2010-08-20
3
468 Views
Last Modified: 2012-06-21
Hi,

Do you know of any email contacts grabber library in Python?
i.e. The user supplies the username and password of gmail to a site, and the site using a library logons to gmail and parses the contact list and extract the emails so that the user can send invites using the gmail contacts.

Thanks
Jamie

0
Comment
Question by:jamie_lynn
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
number1pride earned 500 total points
ID: 33526948
This library should do it:
http://libgmail.sourceforge.net/

If that does not do it there are many other options here:
http://code.google.com/hosting/
0
 

Author Comment

by:jamie_lynn
ID: 33527205
Hi number1pride,

I was hoping for a library that does all the major emails.
Similar to this, but this library doesn't have python
http://www.rocketdownload.com/scripts/program/yahoo--gmail--hotmail-and-aol-contact-grabber-11523.html

Thanks
Jamie
0
 
LVL 1

Assisted Solution

by:number1pride
number1pride earned 500 total points
ID: 33548312
Jamie,

You should be able to use the imap library for this, at least for gmail and yahoo.  For hotmail is a little more complicated and not sure if you can use imap for aol.

So i think this should give you a start "imaplib'

Here is an example for gmail:


import imaplib

usr="user@gmail.com"
pwd="yourpassword"

gmail = imaplib.IMAP4_SSL('imap.gmail.com', 993)
gmail.login(usr,pwd)

status, count = gmail.select('Inbox')
print status
status, data = gmail.fetch(count[0], '(UID BODY[TEXT])')

print data[0][1]
gmail.close()
gmail.logout()

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now