| Visual Basic (Declaration) | |
|---|---|
<DescriptionAttribute("Enumerates how much of a message should be transferred.")> Public Enum MessageSection Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As MessageSection | |
| C# | |
|---|---|
[DescriptionAttribute("Enumerates how much of a message should be transferred.")] public enum MessageSection : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
[DescriptionAttribute("Enumerates how much of a message should be transferred.")] __value public enum MessageSection : public System.Enum | |
| C++/CLI | |
|---|---|
[DescriptionAttribute("Enumerates how much of a message should be transferred.")] public enum class MessageSection : public System.Enum | |
| Member | Description |
|---|---|
| Complete | Automatically gets entire message after logging in. |
| Header | Automatically gets all message header after logging in. |
| None | Disables automatic message retrieval. |
The following example demonstrates retrieving a single POP message.
| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. ' This example demonstrates getting a single message. To do ' this, you must login and keep the connection. Set AutoLogout ' to false to disable auto logout. Pop1.AutoLogout = False ' Do not automatically get any part of the message. Pop1.AutoGet = MessageSection.None ' Login Pop1.Login("mail.test.com", "testuser", "testpass") ' Check to see if any messages were retrieved. If Pop1.Messages.Length > 0 Then ' Get the first message. Pop1.Messages(0).Get() ' Display data about this message. Debug.WriteLine("From: " + Pop1.Messages(0).Message.From.Address) Debug.WriteLine("Subject: " + Pop1.Messages(0).Message.Subject) End If ' Logout has to be explicitly done since AutoLogout = false Pop1.Logout() | |
| C# | Copy Code |
|---|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;" // at the top of your class. // This example demonstrates getting a single message. To do // this, you must login and keep the connection. Set AutoLogout // to false to disable auto logout. pop1.AutoLogout = false; // Do not automatically get any part of the message. pop1.AutoGet = MessageSection.None; // Login pop1.Login("mail.test.com", "testuser", "testpass"); // Check to see if any messages were retrieved. if(pop1.Messages.Length > 0) { // Get the first message. pop1.Messages[0].Get(); // Display data about this message. Debug.WriteLine("From: " + pop1.Messages[0].Message.From.Address); Debug.WriteLine("Subject: " + pop1.Messages[0].Message.Subject); } // Logout has to be explicitly done since AutoLogout = false pop1.Logout(); | |
To automatically get all messages after logging in, set the Pop.AutoGet property to MessageSection.Complete. To automatically get only the message header after logging in, set the Pop.AutoGet property to MessageSection.Header. To disable automatic message retrieval, set the Pop.AutoGet property to MessageSection.None. If messages are not retrieved, you will have to retrieve the messages you want using the PopMessage.Get method.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.MessageSection
Target Platforms: Microsoft .NET Framework 2.0