Retrieving all messages |
Upon establishing a connection to a IMAP server you can retrieve all messages in the account mailbox by invoking the GetMessages method. Any messages found are returned as an Enumeration.
Example
[C#] myImap.Connect(); IEnumerator e = myImap.GetMessages(); while(e.MoveNext()) { EmailMessage message = (EmailMessage)e.Current; // write out message subject Console.Writeline(message.GetSubject()); }
[Visual Basic] myImap.Connect() Dim e As IEnumerator = myImap.GetMessages() Dim message As EmailMessage = Nothing While (e.MoveNext()) message = e.Current ' write out message subject Console.WriteLine(message.GetSubject()) End While
|