0 votes
by (8.4k points)
edited

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)
    client.Delete(msg.SequenceNumber);
client.Disconnect();

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 (17.7k points)
edited
 
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

...