0 votes
by (8.4k points)

I've deleted all messages from my Gmail mailbox using the following code:

Pop3 client = new Pop3(); 
client.Connect("pop.gmail.com", Pop3.DefaultImplicitSslPort, null, Pop3Security.Implicit);
client.Login("username", "password");
Pop3MessageCollection messages = client.GetMessageList(Pop3ListFields.FullHeaders);
Console.WriteLine("Processsing {0} messages...", messages.Count);
foreach (Pop3MessageInfo msg in messages)

The first execution successfully processes all messages, any next execution finds no message in my POP3 mailbox.

However, when I connect to the Gmail through their web pages, the deleted messages are still visible in my Inbox.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
by (18.0k points)
Best answer

You have to specify on Gmail what to do with messages deleted through POP3 protocol. Log to your account on www.gmail.com and change the settings according to following instructions:

How to set Gmail account to delete messages using POP3 protocol