我正在使用C#.net和Asp.net開發一個使用的Web應用程序。如何從gmail或雅虎或rediffmail使用C#獲取聯繫人列表.net
有一個選項可以批量邀請朋友。
爲此,Logined用戶可以導入自己的聯繫方式,從他們的電子郵件帳戶 (如
的Gmail,
YahooMail,
Rediffmail,
的Hotmail,
AOL,
微軟的Outlook Express,
SIFY等...)用我的應用程序。
我該怎麼辦?
我正在使用C#.net和Asp.net開發一個使用的Web應用程序。如何從gmail或雅虎或rediffmail使用C#獲取聯繫人列表.net
有一個選項可以批量邀請朋友。
爲此,Logined用戶可以導入自己的聯繫方式,從他們的電子郵件帳戶 (如
的Gmail,
YahooMail,
Rediffmail,
的Hotmail,
AOL,
微軟的Outlook Express,
SIFY等...)用我的應用程序。
我該怎麼辦?
從Gmail中您可以使用.Net library for the Google Data Protocol
你應該看看尤其是在Google.Contacts
命名空間,它瞄準的是Google Contacts Data API
(link) 查詢聯繫人。
從雅虎你可以使用Yahoo Contacts API。 Yahoo API使用Yahoo Query Language
(YQL)。
我從來沒有用過它,但谷歌搜索想出了http://openinviter.com/這似乎是一個開放的協議,從各種許多提供商導入聯繫人。
嘗試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();
您可以使用opencontactsNet.dll獲取聯繫人。
using OpenContactsNet;
OpenContactsNet.GmailExtract gm = new OpenContactsNet.GmailExtract();
NetworkCredential nw = new NetworkCredential("[email protected]", "");
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'/>");
}
以前我有這樣的任務,我用這真棒LIB openinviter解決它。 它開發的PHP,使用它從C#我寫了簡單的PHP REST服務。 希望它能幫助你。