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


Product List
  "I am happy, thank you very much! I appreciate all your efforts to help me with support on these things, TimeZones and DST are painful for me."
J. Barshinger
 
More
Testimonials
  FAQ
      What is aspNetPOP3?
 
      Who needs aspNetPOP3?
 
      What is the difference between MIME, POP3 and SMTP?
 
      What do I need to run aspNetPOP3?
 
      What is aspNetMime and why is it bundled with aspNetPOP3?
 
      How do I use aspNetPOP3?
 
      How do I connect to a POP3 Server?
 
      How can I get a listing of emails?
 
      Can I bind the emails to an ASP.NET Datagrid?
 
      How can I save POP3 attachments?
 
      I don't like aspNetPOP3, why didn't you make it better?
 
      What does "Unable to Locate License File." mean?
 
What is aspNetPOP3?
  aspNetPOP3 is a server component. It requires the Microsoft .NET runtime in order to function properly. aspNetPOP3 is used to programmatically retrieve email from POP3 mail servers, along with managing email messages.

aspNetPOP3 also requires aspNetMime (an email/MIME message parsing component), to properly parse email messages. aspNetMime is automatically bundled with aspNetPOP3, free of charge.
 
Who needs aspNetPOP3?
  Anyone who needs to check email, in a programmatic manner, can use aspNetPOP3. Some examples of aspNetPOP3 in use are:
  • Building a web based email interface
  • Monitoring mail servers
  • Building an intranet mail application
  • Building a webservce to expose POP3 functionality
  • Building a winform email client
 
What is the difference between MIME, POP3 and SMTP?
  MIME, POP3 and SMTP are all email related protocols. POP3 and SMTP are actually transport protocols. POP3 (aspNetPOP3) is used for retrieving email, while SMTP (aspNetEmail) is used for sending email. MIME (aspNetMime) is used to read and parse the email message itself, not for transporting the message.
 
What do I need to run aspNetPOP3?
  aspNetPOP3 is a low overhead, highly optimized assembly, that needs the Microsoft .NET (or equivalent) framework to run. Any system that can support the Microsoft.NET framework will be able to use aspNetPOP3. aspNetPOP3 can be used from any environment supported by .NET, which can include winforms, ASP.NET, console applications, components, or web services. To actually read and parse the email message, aspNetPOP3 relies on aspNetMime, which is bundled at no charge with aspNetPOP3.
 
What is aspNetMime and why does aspNetPOP3 come bundled with it?
  aspNetMime is an email/MIME message parsing component. aspNetPOP3 is used for communication with the POP3 server, and provides minimal email message parsing. aspNetMime is a complete email/MIME message parsing component, and comes bundled for free with aspNetPOP3.

For more information about aspNetMime, visit www.aspNetMime.com.
 
How do I use aspNetPOP3?
  aspNetPOP3 can only be used programmatically from a .NET environment, including, but not limited to, ASP.NET, winforms, console applications, and web services. Here are two brief examples for using aspNetPOP3 from C# and Visual Basic. The following example downloads a POP3 message as text. For more examples, click here.

[C#]

 
POP3 pop = new POP3( "127.0.0.1", "dave@blah.com", "mypassword");
 
 //if we have 
write permissions we can log the session 
pop.LogPath = "c:\\aspNetPOP3.log";
pop.LogOverwrite = true;
 
 //if we don't have write permissions 
 //(as in an ASP.NET application, we can maintain the log in memory)
pop.LogInMemory = true;
 
 //connect to the POP3 server
 pop.Connect();
 
 //get the number of messages and the size of the inbox
pop.PopulateInboxStats();
 
Console.WriteLine( "There are {0} messages waiting.", pop.InboxMessageCount );
Console.WriteLine( "The total inbox size is {0} bytes.", pop.InboxSize );
 
 //get a message
 string text = pop.GetMessageAsText( 1 );
 
 //show the message
Console.WriteLine( text );
 
 //Close the POP3 Connection
pop.Disconnect();
 
 //display the log 
Console.WriteLine( "Log----");
Console.WriteLine( pop.Log );

 

[VB.NET]

Dim pop As New POP3("127.0.0.1", "dave@blah.com", "mypassword")

'if we have write permissions we can log the session
pop.LogPath = "c:\aspNetPOP3.log"
pop.LogOverwrite = True

'if we don't have write permissions
'(as in an ASP.NET application, we can maintain the log in memory)
pop.LogInMemory = True

'connect to the POP3 server
pop.Connect()

'get the number of messages and the size of the inbox
pop.PopulateInboxStats()

Console.WriteLine("There are {0} messages waiting.", pop.InboxMessageCount)
Console.WriteLine("The total inbox size is {0} bytes.", pop.InboxSize)

'get a message
Dim emailText As String = pop.GetMessageAsText(1)

'show the message
Console.WriteLine(emailText)

'Close the POP3 Connection
pop.Disconnect()

 
How do I connect to a POP3 Server?
  aspNetPOP3 makes it easy to connect to mail servers. The following code demonstrates connecting to a POP3 server in both C# and Visual Basic.

[C#]

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

//if we have write permissions we can log the session
pop.LogPath = "c:\\aspNetPOP3.log";
pop.LogOverwrite = true;

//if we don't have write permissions 
//(as in an ASP.NET application, we can maintain the log in memory)
pop.LogInMemory = true;

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

//get the number of messages and the size of the inbox
pop.PopulateInboxStats();

Console.WriteLine( "There are {0} messages waiting.", pop.InboxMessageCount );
Console.WriteLine( "The total inbox size is {0} bytes.", pop.InboxSize );


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

//display the log
Console.WriteLine( "Log----");
Console.WriteLine( pop.Log );

[Visual Basic]


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

//if we have write permissions we can log the session
pop.LogPath = "c:\\aspNetPOP3.log";
pop.LogOverwrite = true;

//if we don't have write permissions 
'(as in an ASP.NET application, we can maintain the log in memory)
pop.LogInMemory = true;

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

//get the number of messages and the size of the inbox
pop.PopulateInboxStats();

Console.WriteLine( "There are {0} messages waiting.", pop.InboxMessageCount );
Console.WriteLine( "The total inbox size is {0} bytes.", pop.InboxSize );


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

//display the log
Console.WriteLine( "Log----");
Console.WriteLine( pop.Log );



 
How can I get a listing of emails?
  Email headers can either be downloaded as an ArrayList or a DataTable. There are two methods on the POP3 class that can obtain this functionality:
  • HeaderList()
  • HeaderTable()


    • Below are two code samples that demonstrate the HeaderList() method.

      [C#]

      POP3 pop = new POP3();
      
      //connect to the POP3 server
      pop.Connect("dave@blah.com", "mypassword","127.0.0.1" );
      
      //get a datatable of headers
      ArrayList al = pop.HeaderList();
      
      for( int i=0;i<al.Count;i++)
      {
          Console.WriteLine("-------------------------------");
          Console.WriteLine( al[i].ToString() );
      }
      
      //Close the POP3 Connection
      pop.Disconnect();
      

      [Visual Basic]

      Dim pop As New POP3()
      
      'connect to the POP3 server
      pop.Connect("dave@blah.com", "mypassword", "127.0.0.1")
      
      'get a datatable of headers
      Dim al As ArrayList = pop.HeaderList()
      
      Dim i As Integer
      For i = 0 To al.Count - 1
          Console.WriteLine("-------------------------------")
          Console.WriteLine(al(i).ToString())
      Next i
      
      'Close the POP3 Connection
      pop.Disconnect()
                  
      

 
Can I bind the emails to an ASP.NET Datagrid?
  aspNetPOP3 allows email headers and messages to be downloaded as DataTable. This functionality provides great data binding capabilities, including binding emails to a DataGrid, DataList, and DataRepeaters. The following example demonstrates downloading headers as a DataTable, and binding them to a DataGrid.

[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 (inclusive)
DataTable dt = pop.HeaderTable(3, 5);


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


//html encode the cells
for( int r=0;r<dt.Rows.Count;r++)
{
    //skip the first col because it's an Int32
    for( int c=1;c<dt.Columns.Count;c++)
    {
        string cellValue = dt.Rows[r][c].ToString();
        dt.Rows[r][c] = "<pre>" + Server.HtmlEncode( cellValue ) + "</pre>";
    }
}

//display the datagrid in ASP.NET page
DataGrid dg = new DataGrid();
dg.DataSource = dt;
dg.DataBind();
Page.Controls.Add( dg );

[Visual Basic]


'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()

'get the messages 3-5 (includes message 3,4, and 5 ) as a DataTable            
Dim dtMsg As DataTable = pop.MessageTable(3, 5)

'Close the POP3 Connection
pop.Disconnect()


'html encode the cells
Dim r As Integer
For r = 0 To dtMsg.Rows.Count - 1
    'skip the first col because it's an Int32
    Dim c As Integer
    For c = 1 To dtMsg.Columns.Count - 1
        Dim cellValue As String = dtMsg.Rows(r)(c).ToString()
        dtMsg.Rows(r)(c) = "<pre>" + Server.HtmlEncode(cellValue) + "</pre>"
    Next c
Next r

'display the  DataTable in a DataGrid in an ASP.NET page
Dim dgMsg As New DataGrid()
dgMsg.DataSource = dtMsg
dgMsg.DataBind()
Page.Controls.Add(dgMsg)


 
How can I save POP3 attachments?
  Together, along with aspNetMime, aspNetPOP3 can easily save attachments to the file system. The following code demonstrates this capability in C# and Visual Basic.

[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();
            
Message msg = pop.GetMessage(1 );

//save attachments to a directory
msg.SaveAttachments( "c:\\temp\\mydirectory\\", true );

pop.Disconnect();

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

[Visual Basic]

'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()

Dim msg As Message = pop.GetMessage(1)

'save attachments to a directory
msg.SaveAttachments("c:\temp\mydirectory\", True)

pop.Disconnect()

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

 
I don't like aspNetPOP3, why didn't you make it better?
  Tell us what we are doing wrong. We love to get feedback, both good and bad. If you have some specific points about aspNetPOP3, please tell us, so we can make a better product. Feel free to contact us at support@advancedIntellect.com
 
What does "Unable to Locate License File." mean?
  Starting with version 2.0, aspNetPOP3's license file is now external to the aspNetPOP3.dll and aspNetMime.dll. The license file is named aspNetPOP3.xml.lic, and is a digitally signed text file (feel free to view the file in notepad). The license file can be dropped into your /bin directory, or added to the same directory as your .exe or .dll. You can also manually load the license file by calling
POP3.LoadLicenseFile( path )
Where path is the file system path to the .lic file. For more information on how licensing works, feel free to check out our licen.aspx page.

 

 

 

 

 



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