0

I am unable to get the correct message count in case of accessing gmail using OpenPop.Net. It works perfectly fine with hotmail give the correct email count that is in my inbox

pop3Client.Connect(popServerTextBox.Text, int.Parse(portTextBox.Text), useSslCheckBox.Checked);
pop3Client.Authenticate(loginTextBox.Text, passwordTextBox.Text,OpenPop.Pop3.AuthenticationMethod.UsernameAndPassword);
int count = pop3Client.GetMessageCount();
laylarenee
  • 3,276
  • 7
  • 32
  • 40
Umar Malik
  • 63
  • 4
  • 10

2 Answers2

2

gMail is different. They have a funny implementation of their POP3 servers. Basically, they try to only show you messages that you have not seen before.

Take a look at What non-standard behaviour features does Gmail exhibit, when it is programmatically used as a POP3 server?

Community
  • 1
  • 1
foens
  • 8,642
  • 2
  • 36
  • 48
  • So whats the fix?? the reference link is of pertinent information but does not solve my issue. – Umar Malik Sep 18 '12 at 09:06
  • 1
    The fix is either to use the recent: keyword at login or to use IMAP instead. Meaning, there is no simple fix. At least not that I know of. – foens Sep 18 '12 at 12:18
0

It's a feature of gmail pop3 server. By default, you can receive only unread messages. That means, if you or somebody else already has downloaded certain message once, it will not be possible to receive it by pop3 protocol anymore.

To avoid it, you have to configure your gmail account. Check "Enable POP for all mail (event mail that's already been downloaded)" in "Forwarding and POP/IMAP" section of gmail settings.

Screenshot: https://i.stack.imgur.com/UE7ip.png

Source : GetMessageCount() returns 0 (zero)

Community
  • 1
  • 1
Mandeep Janjua
  • 15,583
  • 4
  • 29
  • 24