Gets an array of ImapMessage objects representing all messages effected by the asynchronous method.
Syntax
| Visual Basic (Declaration) | |
|---|
Public ReadOnly Property Messages As ImapMessage() |
| Managed Extensions for C++ | |
|---|
public: __property ImapMessage*[]* get_Messages(); |
Property Value
Returns an array of ImapMessage objects representing the message.
Example
The following example demonstrates using the Mailbox.BeginSearch method. This example constructs the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
| Visual Basic | Copy Code |
|---|
Private Sub AsynchronousSearchTest()
' Login
Imap1.Login(Server, User, Pass)
' Construct the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
Dim Criteria As New ArrayList()
Criteria.Add(New ImapSearchParameter(ImapCriterion.Flagged, ""))
Criteria.Add(New ImapSearchParameter(ImapCriterion.Since, "1-Feb-1994"))
Criteria.Add(New ImapSearchParameter(ImapCriterion.Not, ""))
Criteria.Add(New ImapSearchParameter(ImapCriterion.From, "Smith"))
' Alternatively, ImapSearchParameter objects can be created like so
' Dim Param As New ImapSearchParameter()
' Param.Criterion = ImapCriterion.Flagged
' Param.Paramter = ""
' Criteria.Add(Param)
' Perform the search. This will occur on the default box INBOX.
Imap1.CurrentMailbox.BeginSearch(Criteria, Nothing)
End Sub
Private Sub Imap1_EndSearch(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapMessageEventArgs) Handles Imap1.EndSearch
If e.Exception Is Nothing Then
' The following messages meet the criteria
Dim Msg As ImapMessages
For Each Msg In e.Messages
Debug.WriteLine("Message: " + Msg.Id)
Next
End Sub
End Sub |
| C# | Copy Code |
|---|
private void AsynchronousSearchTest()
{
// Login
imap1.Login(Server, User, Pass);
// Construct the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
ArrayList criteria = new ArrayList();
criteria.Add(new ImapSearchParameter(ImapCriterion.Flagged, ""));
criteria.Add(new ImapSearchParameter(ImapCriterion.Since, "1-Feb-1994"));
criteria.Add(new ImapSearchParameter(ImapCriterion.Not, ""));
criteria.Add(new ImapSearchParameter(ImapCriterion.From, "Smith"));
/*
/ Alternatively, ImapSearchParameter objects can be created like so
/ ImapSearchParameter param = new ImapSearchParameter();
/ param.Criterion = ImapCriterion.Flagged;
/ param.Paramter = "";
/ criteria.Add(param);
*/
// Perform the search. This will occur on the default box INBOX.
imap1.CurrentMailbox.BeginSearch(criteria, null);
}
private void imap1_EndSearch(object sender, Dart.PowerTCP.Mail.ImapMessageEventArgs e)
{
if(e.Exception == null)
{
// The following messages meet the criteria
foreach(ImapMessage msg in e.Messages)
Debug.WriteLine("Message: " + msg.Id);
}
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also