PowerTCP Mail for .NET
Id Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > MessageBase Class : Id Property




Returns the id of the message.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Id As String
Visual Basic (Usage)Copy Code
Dim instance As MessageBase
Dim value As String
 
value = instance.Id
C# 
public string Id {get;}
Managed Extensions for C++ 
public: __property string* get_Id();
C++/CLI 
public:
property String^ Id {
   String^ get();
}

Property Value

An integer representing the identification number of the message.

Example

The following example demonstrates logging into a POP server and retrieving all messages.
Visual BasicCopy 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);
}

Remarks

MessageBase.Id is initialized at login to an auto-incremented integer, ranging from 1 to number of messages. This property is useful for referring to a particular message within your application. Note: MessageBase.Id is 1-based and MessageBase.Messages is 0-based, so to access the message with id "1" you will have to access MessageBase.Messages[0].

This value may change as messages are added or removed.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.