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.

asked 04 Apr '11, 13:26

Rebex%20KB's gravatar image

Rebex KB ♦♦
258519
accept rate: 63%


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

link

answered 04 Apr '11, 14:24

Jan%20Sotola's gravatar image

Jan Sotola ♦♦
3566
accept rate: 36%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×36
×20

Asked: 04 Apr '11, 13:26

Seen: 850 times

Last updated: 04 Apr '11, 14:24