The Pop component enables the integration of Post Office Protocol (POP) functionality into any .NET application.

| Visual Basic (Declaration) | |
|---|---|
<LicenseProviderAttribute(PopLicenseProvider)> Public Class Pop Inherits System.ComponentModel.Component | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Pop | |
| C# | |
|---|---|
[LicenseProviderAttribute(PopLicenseProvider)] public class Pop : System.ComponentModel.Component | |
| Managed Extensions for C++ | |
|---|---|
[LicenseProviderAttribute(PopLicenseProvider)] public __gc class Pop : public System.ComponentModel.Component | |
| C++/CLI | |
|---|---|
[LicenseProviderAttribute(PopLicenseProvider)] public ref class Pop : public System.ComponentModel.Component | |
| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. ' Automatically remove files after getting them from the server Pop1.AutoDelete = True ' Login. The default settings will cause the Pop component to ' automatically retrieve all messages, delete them from the ' server, and logout. Pop1.Login("mail.test.com", "testuser", "testpass") ' All message retrieved. Iterate through the collection ' and display data. Dim msg As PopMessage For Each msg In Pop1.Messages Debug.WriteLine("Message ID: " + msg.Id) Debug.WriteLine("Message UID: " + msg.Uid) Debug.WriteLine("Messge Size: " + msg.Size) Debug.WriteLine("From: " + msg.Message.From.Address) Debug.WriteLine("Subject: " + msg.Message.Subject) Next | |
| C# | Copy Code |
|---|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;" // at the top of your class. // Automatically remove files after getting them from the server pop1.AutoDelete = true; // Login. The default settings will cause the Pop component to // automatically retrieve all messages, delete them from the // server, and logout. pop1.Login("mail.test.com", "testuser", "testpass"); // All message retrieved. Iterate through the collection // and display data. foreach(PopMessage msg in pop1.Messages) { Debug.WriteLine("Message ID: " + msg.Id); Debug.WriteLine("Message UID: " + msg.Uid); Debug.WriteLine("Messge Size: " + msg.Size); Debug.WriteLine("From: " + msg.Message.From.Address); Debug.WriteLine("Subject: " + msg.Message.Subject); } | |
The Pop component enables the integration of Post Office Protocol (POP) functionality into any .NET application, allowing your application to easily receive Internet mail. Flexible POP message support enables easy retrieval of POP messages. Other features include synchronous and asynchronous use, proxy support, and the ability to send commands.
Using the Pop Component
What follows are short descriptions of common usability issues. For a more complete, "walk-through" type description, see Using PowerTCP Secure Mail for .NET.
Easy session management: The Pop.Login method authenticates to the server and populates the Pop.Messages collection with information about the messsages present in the mail drop. If the Pop.AutoLogout property is true, the session will be closed after all communication is complete. If Pop.AutoLogout is false, the session will have to be explicitly closed using Pop.Logout.
Flexible message retrieval: The quickest and easiest way to retrieve messages is to set Pop.AutoGet = MessageSection.Complete, and the Pop.Messages collection will automatically get all messages after the Pop.Login method is used. To retrieve an individual message, use the Pop.Messages[n].Get method. Messages can be retrieved into a MessageStream object (for easy decoding) or into any other type of Stream object (for your own implementation).
Advanced attachment decoding: Attachments are decoded "on the fly" eliminating any need for disk access, making your application faster and more efficient. In addition, attachments can be automatically decoded and saved as files, or decoded into MemoryStreams to use within your application.
Synchronous Use: Most applications written with the Pop component will be synchronous, meaning that the application, when calling a synchronous method, will not execute the next line of code until the response is received. Use synchronous methods when the receiving of mail does not have to be transparent to the user.
Asynchronous Use: The Pop component fully supports asynchronous use, meaning that the application, when calling an asynchronous method, will immediately execute the next line of code without waiting for the response from the method. When the response is received, an event will be raised.
Displaying Progress: The Pop.Progress event provides real-time notification of the number of bytes sent, both for a single messages and all messages.
Accessing POP Protocol Communication: The Pop.Trace event enables access to all commands and data sent over the TCP connection.
Retrieving info about the control connection: The TCP control connection is exposed through the Pop.Connection property, allowing access to low-level properties and methods. This can be used to view TCP-level activity, such as the local and remote IP address. The Pop.Connection property can also be used to send any command to the mail server. Furthermore, you can use the Proxy property of this object to enable automatic communication with proxy servers when getting mail. The Tcp class can't be used on its own without a license for the PowerTCP
Sending commands to the server: Any command (including proprietary commands) can be sent to a POP server using the Pop.Connection.Send method.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Dart.PowerTCP.Mail.Pop
Target Platforms: Microsoft .NET Framework 2.0