Returns the collection of UIDs of all messages in the currently selected folder.
Namespace: MailBee.ImapMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public UidCollection Search()
Public Function Search As UidCollection
Return Value
Type:
UidCollectionUidCollection object if the command succeeded; otherwise, a null reference (
Nothing in Visual Basic).
Exceptions Remarks
This method can be used to enumerate UID values of all messages in the folder.
Examples using System;
using MailBee;
using MailBee.ImapMail;
class Sample
{
static void Main(string[] args)
{
Imap imp = new Imap();
imp.Connect("mail.host.com");
imp.Login("jdoe@host.com", "secret");
imp.SelectFolder("INBOX");
UidCollection uids = imp.Search();
Console.WriteLine("uids as message set (i.e. message sequence):");
Console.WriteLine(uids.ToString());
Console.WriteLine();
Console.WriteLine("uids as a list of UIDs:");
foreach (long uid in uids)
{
Console.WriteLine(uid);
}
imp.Disconnect();
}
}
Imports System
Imports MailBee
Imports MailBee.ImapMail
Module Sample
Sub Main()
Dim imp As New Imap
imp.Connect("imap4.company.com")
imp.Login("jdoe@company.com", "secret")
imp.SelectFolder("INBOX")
Dim uids As UidCollection = imp.Search()
Console.WriteLine("uids as message set (i.e. message sequence):")
Console.WriteLine(uids.ToString())
Console.WriteLine()
Console.WriteLine("uids as a list of UIDs:")
For Each uid As Long In uids
Console.WriteLine(uid)
Next
imp.Disconnect()
End Sub
End Module
See Also