Deleting a Message
The following example demonstrates deleting a message, and then canceling pending deletes.

[C#]

POP3 pop = new POP3("127.0.0.1","dave@blah.com", "mypassword" ); //connect to the POP3 server pop.Connect(); //delete the message pop.Delete( 1 ); pop.Delete( 2 ); //commit the deletes pop.CommitDeletes(); //decide you want to delete Message 3 pop.Delete( 3 ); //now change your mind pop.CancelDeletes(); //Close the POP3 Connection pop.Disconnect(); //done Console.WriteLine( "done."); Console.ReadLine( );


[VB.NET]

Dim pop As New POP3("127.0.0.1", "dave@blah.com", "mypassword") 'connect to the POP3 server pop.Connect() 'delete the message pop.Delete(1) pop.Delete(2) 'commit the deletes pop.CommitDeletes() 'decide you want to delete Message 3 pop.Delete(3) 'now change your mind pop.CancelDeletes() 'Close the POP3 Connection pop.Disconnect() 'done Console.WriteLine("done.") Console.ReadLine()