Karthi Keyan

Karthi Keyan

  • 996
  • 755
  • 238.7k

send mail using SMTP in C#

Aug 26 2016 9:40 AM
Hi.
I worked with sending the mail from my app using SMTP in c#. It works Fine. But  when I am trying to retrieve the Contacts from my gmail A/C  i got the error "Execution of authentication request returned unexpected result: 404" . I tried all in google sites. the coding was same in the site which i written. 
 
i can't find the solution. i paste my code here. waiting for the help. thanks in advance.
 
try
{
RequestSettings rs = new RequestSettings("My Application", txtfromadd.Text, txtpassword.Text);
rs.AutoPaging = true;
ContactsRequest cr = new ContactsRequest(rs);
Feed<Contact> f = cr.GetContacts();
foreach (Contact c in f.Entries)
{
int i = 1;
foreach (EMail M in c.Emails)
{
grid.Rows.Add(false, i, M.Address.ToString());
i++;
}
}
}
catch(Exception ds)
{
MessageBox.Show(ds.Message);
}
 

Answers (3)