CurtGroen
  • CurtGroen
  • 51.5% (Neutral)
  • Newbie Topic Starter
5 years ago
I'm using EAGetMail library to read emails from Gmail. This is my code:

private void readMails(){
MailServer oServer=new MailServer("pop.gmail.com", "something@gmail.com", "noneedtoseethis", ServerProtocol.Pop3);
MailClient oClient = new MailClient("Client");
oServer.SSLConnection = true;
oServer.Port = 995;
try {
oClient.Connect(oServer);
MailInfo[] infos = oClient.GetMailInfos();
Console.WriteLine(infos.Length);
for (int i = 0; i < infos.Length; i++){
MailInfo info = infos[i];
Mail oMail = oClient.GetMail(info);

Console.WriteLine("From: {0}", oMail.From.ToString());
//oClient.Delete(info);
}
oClient.Quit();
} catch (Exception ep) {
Console.WriteLine(ep.Message);
}
}



Though it appears the only thing that it gets are the new messages I receive
which are 2 or 3 every five minutes.

But I want to read all emails I have in the inbox, not just the new coming messages
How can I do that?
ivan
  • ivan
  • 100% (Exalted)
  • Administration
5 years ago
Please use IMAP protocol instead of POP protocol, then you can read all emails.

Retrieve emails from Gmail IMAP server 

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.