Import email addresses like in any social networking site.Below example we have used to fetch the gmail address.
For this we require Google Data API and install the same to get the required dlls.
Add these dlls as reference in your project.
1. Google.GData.Client
2. Google.GData.Contacts
3. Google.GData.Extensions
Use .net framework 3.5 or 4.0
Code
Default.aspx.cs
Download Code
For this we require Google Data API and install the same to get the required dlls.
Add these dlls as reference in your project.
1. Google.GData.Client
2. Google.GData.Contacts
3. Google.GData.Extensions
Use .net framework 3.5 or 4.0
Code
Default.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Google.Contacts; using Google.GData.Client; using Google.GData.Contacts; using Google.GData.Extensions; namespace GmailContacts { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } #region FETCH EMAIL IDS private ListEmailLists.csFetchEmailIds(string emailid, string password) { List emaillist = new List (); try { RequestSettings Logindetails = new RequestSettings("", emailid, password); Logindetails.AutoPaging = true; ContactsRequest getRequest = new ContactsRequest(Logindetails); Feed listContacts = getRequest.GetContacts(); foreach (Contact mailAddress in listContacts.Entries) { // Response.Write(mailAddress.Title + " "); foreach (EMail emails in mailAddress.Emails) { EmailLists emailaddress = new EmailLists(); emailaddress.Title = mailAddress.Title; emailaddress.EmailAddress = emails.Address; //Response.Write(emails.Address + " "); emaillist.Add(emailaddress); } } } catch (Exception) { Label1.Text = "Sorry your email id or password does not match."; } return emaillist; } protected void Button1_Click(object sender, EventArgs e) { GridView1.DataSource = FetchEmailIds(txtEmailId.Text, txtPassword.Text); GridView1.DataBind(); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace GmailContacts { public class EmailLists { public string Title { get; set; } public string EmailAddress { get; set; } } }
Download Code
This is amaging and easy to integrate.
ReplyDeleteSir Do you have any such thing Yahoo and AOL grabber
Thanks
Prashant
nice one but iam using 3.5 framework,im adding dll in to bin folder but there is no effect on namespace side."there is no name or object reference "google" like this error will be displaying what im doing now reply
Deletenice one but iam using 3.5 framework,im adding dll in to bin folder but there is no effect on namespace side."there is no name or object reference "google" like this error will be displaying what im doing now reply
ReplyDeleteYou can download all the dlls from google.com
ReplyDeleteyes i have downloaded all the dlls from google.com like
ReplyDeleteusing Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;
but raising an error on "Google" same error in every page
I am using the same code but it works with some id But
ReplyDeleteIt is not working with some another gmail id ?
Execution of authentication request returned unexpected result: 404
ReplyDeletehow to overcome this error.