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