Reading Contacts(Address Book) from Yahoo, Gmail, Rediff, MSN, AOL

Saturday, September 13, 2008
When we are developing a scoal networking websites or Some Referal websites, when the user registration completed then we have to provide an interface to invite the registerd user friends. For this purpose we have to provide option to get contcats (AddressBook) from various Email Providers.





Here I am taking some popular Email Providers like Yahoo, Google, MSN, Rediff, AOL. In order to Read the Address book of Yahoo, Google, Rediff, MSN, AOL we have access the API which provided by them itself.
Few days before I download one one dll from net. Its provided by Ideabubling. It contains all API of Yahoo,Google, Rediff, MSN, AOL, which is ready to use. Here In this application I use the dll.


The Core Functionality is, when user provides Email Address and Password, If these details are valid then we will call getContact method and these details are stored in DataTable. You can see the sample code here..


DataTable dtContatct = new DataTable();

MailType mt = FindTheMailType();

MailClient.GetContacts(mt, strUserid, strPassword, out boolIsOK, out dtContatct, out strError);

dtContatct = MailClient.GetFormat(mt, dtContatct);



Here “mt” is the mail type. It will check what type of Email Address It is. Either Yahoo, Gmail, etc.
Then this DataTable is binded with GridView, so that User can able to see his contcats and he can select some of the or all to send a mail.
You can see the Screen Shot..


Download Complete Application.. Click Here..!

24 comments:

Donepudi said...

Thnx Ramky.. Can u give sample code for cropping an Image like in Orkut.

Jinto said...

Hi,

Its working with Yahoo and Gmail but there is some issue with other email providers please can you suggest what may be the issue.

Unknown said...

Hi Ramcrishna the sample which u provide is gettng error like "Server return a error 403" and Underlying connection was closed and cannot be opened with SSL" this type of errors i'm geting plz it will be very great if u help me. thanx

Unknown said...

I ariciate you post, but its working with Yahoo and Gmail but there is some issue with other email providers please can you suggest what may be the issue.

Unknown said...

I am stucked with AOL and Hot Mail. Please help me.

Amol Bagde said...

check the link http://techprogram.co.in/grab-address-book.php

Unknown said...

Its not working.No result is showing.please help....sadhana

Charanpreet said...

Thnx Ramky,i followed the code,understand and make the changes, now its working for yahoo,gmail,aol. However i'm stuck with final stag of hotmail.

Unknown said...

hi...this code is not working..

Amit Shelke said...

this code does not work for hotmail

string str20 = response4.Headers[Utility.Location].ToString();

error on this line. str20 returns null.

DOTNETRAMU said...

Hi Ramky, its great work, but i am getting the following error, while executing the statement as follows :

MailClient.GetContacts(mt, strUserid, strPassword, out boolIsOK, out dtContatct, out strError);

--And i am not getting any dtContacts list, annd bookIsOK showing true, while executing this line i am getting the following error(trying to access gmail list)

error:
Input array is longer than the number of columns in this table.

error ;
at ideaBubbling.ContactsReader.Utility.ConvertCSVIntoDataTable(String strCSV)
at ideaBubbling.ContactsReader.Gmail.GetContacts(String strUserName, String strPassword, Boolean& boolIsOK, DataTable& dtContatct, String& strError)
at ideaBubbling.ContactsReader.MailClient.GetContacts(MailType mt, String strUserName, String strPassword, Boolean& boolIsOK, DataTable& dtContatct, String& strError)
at InviteFriends.Button1_Click(Object sender, EventArgs e) in d:\RAM\ContactReader\ContactReader\InviteFriends.aspx.cs:line 228



Please reply me with solution so that i can rectify my code to work perfectly.

thanking you
Please do the needful

Satinder said...

Hi Ramky, You wrote a very nice code, but i am not able to pull yahoo, gmail, hotmail contacts. It just returns me empty data table. When i tried to dig into the code i just see this
public static class MailClient
{
public static void GetContacts(MailType mt, string strUserName, string strPassword, out bool boolIsOK, out DataTable dtContatct, out string strError);
public static DataTable GetFormat(MailType mt, DataTable dtContatct);
}
no implementation. Can u please email me the working code. Thanks in advance (satinder.satty@gmail.com)

Unknown said...

hi,great work.but i have a problem
yahoo is giving the 'application error.'and gmail giving the cloumns doesnot match with datatable.and rediff giving the server time out.please give the response.how to implement in my project....

Unknown said...

More than 6 months I'm using the code for exporting address book. But, now it is not working for Gmail account. Showing the error as "Input array is longer than the number of columns in this table." Can u look at this kindly?? Thank you!!!

Alex said...

In my opinion address books are very of special importance at least for me. On example yesterday I made the acquaintance of VIP man and added his emails in my address book. But today I opened it and didn't observe anything. I was put out and by sheer chance found in the Internet - recovery wab file. It was amazed me,by reason of the software solved my problem for seconds and free of charge as far as I remember. Moreover it helped my relatives too.

Viju said...

hi,

I am getting null value from yahoo.

Can you send me code.

Unknown said...

StesCodes presents the code to grab address contacts of Gmail, Yahoo, AOL, MSN and Hotmail from external website using Asp.net/C#.

1.No DLL's required
2.No EXE's required
3.Works in shared and dedicated server too
4.Easy integration
5.Able to extend the code easily


View online demo here
http://www.stescodes.com/grabcontacts.aspx

Hilly said...

hey Ramky, do you have the ideas bubbling code source. I am looking for just the AOL contacts import code.

Thanks mate.

Nishar said...
This comment has been removed by the author.
Nishar said...

hi all,
this code is not working..!
if any chages there plz tell the change..!

Ramky said...

Hiii All,


I have taken this API from Ideabubling.... Please check with this site.. U may get latest updates....

Philip said...

Please don't use the password anti-pattern. You're teaching users how to get phished. It's a very bad security practice.

rajan said...

hey i paid the amount but not get the code

Định Nguyễn said...

Hi,

I can't get any contact with yahoo,gmail,.... param boolIsOK always have value false. Please help me to resolve it. Tks