Home | Contact Us | Download | Support | Purchase | Shopping Cart | Products


Product List
  "This component rocks. You have saved me hours and hours of development by creating this awesome tool. I have an application due in 2 1/2 weeks and it's going to be extremely robust and feature complete due, in a large part, to your fabulous control. For the cost and the quality, it gets no better."
S.Maiers
Monolith Productions
 
More
Testimonials

Download Messages' Headers as an ArrayList

The following example downloads a range of messages' headers into an ArrayList.

[C#]

//create a new POP3 object
POP3 pop = new POP3("127.0.0.1","dave@blah.com", "mypassword" );

//connect to the POP3 server
pop.Connect();
            

//download the headers for messages 3 - 5 (returns the headers for messages 3, 4, and 5)
ArrayList al = pop.HeaderList(3,5);

for( int i=0;i<al.Count;i++)
{
	Console.WriteLine( "Headers for message number {0}", i+3 ); //add 3 because the ArrayList index is 0
	Console.WriteLine( "---------------------------------------");
	Console.WriteLine( al[i].ToString() );
}

//Close the POP3 Connection
pop.Disconnect();

//done
Console.WriteLine( "done.");
Console.ReadLine( );

 

[VB.NET]


 'create a new POP3 object
Dim pop As New POP3("127.0.0.1", "dave@blah.com", "mypassword")

'connect to the POP3 server
pop.Connect()


'download the headers for messages 3 - 5 (returns the headers for messages 3, 4, and 5)
Dim al As ArrayList = pop.HeaderList(3, 5)

Dim i As Integer
For i = 0 To al.Count - 1
Console.WriteLine("Headers for message number {0}", i + 3) 'add 3 because the ArrayList index is 0
Console.WriteLine("---------------------------------------")
Console.WriteLine(al(i).ToString())
Next i

'Close the POP3 Connection
pop.Disconnect()

'done
Console.WriteLine("done.")
Console.ReadLine()
 



The box is not shipped. aspNetPOP3 is a downloadable product.