开发者

How can i get contact list from gmail or yahoo or rediffmail using C#.net

开发者 https://www.devze.com 2023-03-20 11:34 出处:网络
I am developing a web application using C#.net and Asp.net. There is an option to Bulk invitation to friends.

I am developing a web application using C#.net and Asp.net.

There is an option to Bulk invitation to friends.

For This, Logined user can import their Contacts from their email accounts (like

Gmail,

Ya开发者_运维问答hooMail,

Rediffmail,

Hotmail,

AOL,

Microsoft Outlook Express,

Sify etc...) Using my Application.

How can i do it?


From Gmail you can query the contacts using the .Net library for the Google Data Protocol

You should look especially at the Google.Contacts namespace, which is targeting the Google Contacts Data API ( link ) .

From Yahoo you can use the Yahoo Contacts API. Yahoo APIs use the Yahoo Query Language ( YQL).

I have never used it myself, but a google search came up with http://openinviter.com/ which seems like an open protocol to import contacts from various many providers.


try using with Google.GData.Contacts.dll, Google.GData.Apps.dll

username=your emailid;
password=email password;
app_name="MyNetwork Web Application!";
DataSet ds = GmailContacts.GetGmailContacts(App_Name, username, password);
GridView1.DataSource = ds;
GridView1.DataBind();  


You can use opencontactsNet.dll to fetch contacts.

using OpenContactsNet;
OpenContactsNet.GmailExtract gm = new OpenContactsNet.GmailExtract();
NetworkCredential nw = new NetworkCredential("sainathsagars@yahoo.com", "");
OpenContactsNet.MailContactList ml = new OpenContactsNet.MailContactList();
gm.Extract(nw, out ml);
// Trying to show something
StringBuilder sbMessage = new StringBuilder();
string strcount = (ml.Count + " Contacts : ");
foreach (MailContact mc in ml)
{
    sbMessage.Append(mc.Email + "<hr size='1'/>");
}


Previously I had such task and I solved it by using this awesome lib openinviter. It's developed on php, to use it from C# I wrote simple php REST service. Hope it will help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消