3
Answers

send mail using SMTP in C#

Karthi Keyan

Karthi Keyan

8y
361
1
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)