Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Email .NET
>
Tutorial
> Get message unique ID
This example shows you how to list messages and their unique IDs.
C# example
using System; using Independentsoft.Email; using Independentsoft.Email.Pop3; namespace Sample { class Program { static void Main(string[] args) { Pop3Client client = new Pop3Client("pop3.live.com", 995); client.Connect(); client.Login("example@hotmail.com", "password"); MessageInfo[] messageInfo = client.GetUniqueID(); for (int i = 0; i < messageInfo.Length; i++) { Console.WriteLine("Message index = " + messageInfo[i].Index); Console.WriteLine("Message unique ID = " + messageInfo[i].UniqueID); Console.WriteLine("-----------------------------------------------"); } client.Disconnect(); Console.WriteLine("Press ENTER to exit!"); Console.Read(); } } }
VB example
Imports System Imports Independentsoft.Email Imports Independentsoft.Email.Pop3 Namespace Sample Class Program Shared Sub Main(ByVal args As String()) Dim client As New Pop3Client("pop3.live.com", 995) client.Connect() client.Login("example@hotmail.com", "password") Dim messageInfo As MessageInfo() = client.GetUniqueID() For i As Integer = 0 To messageInfo.Length - 1 Console.WriteLine("Message index = " & messageInfo(i).Index) Console.WriteLine("Message unique ID = " & messageInfo(i).UniqueID) Console.WriteLine("-----------------------------------------------") Next client.Disconnect() Console.WriteLine("Press ENTER to exit!") Console.Read() End Sub End Class End Namespace