OpenPop - Gmail - GetMessageCount () returns 0 (zero)

When connecting to Gmail with OpenPop, I can only receive it once, even if I do not delete it. Using GetMessageCount (), I always get 0 emails. How can I get all the emails I have?

Only after reading them and processing them do I place an order for deletion. To receive emails I use the following code:

using (var client = new Pop3Client()) { // Connect to the server client.Connect(serverData.Hostname, serverData.Port, serverData.UseSsl); // Authenticate ourselves towards the server client.Authenticate(serverData.Username, serverData.Password, AuthenticationMethod.UsernameAndPassword); var emailAmount = client.GetMessageSizes().Count; // Fetch all the current uids seen var msgCount = client.GetMessageCount(); ..... } 
+4
source share
2 answers

Gmail is special . Take a look at fooobar.com/questions/650440 / ... which explains custom behavior.

What you are interested in is that Gmail will only display the message in the ONE POP3 session , unless you are making special materials, such as adding the latter: in front of your username.

+7
source

Receiving only unread emails is how POP3 should work. If you want to see and manage older emails, you should use IMAP instead.

+1
source

Source: https://habr.com/ru/post/1386501/


All Articles