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


POP3 pop = new POP3("","", "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( );


Dim pop As New POP3("", "", "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()