I'm facing a problem. I am able to read messages on my VB.net app using OpenPop, but I'd like to list only unread messages due the long time I should wait to list them all. Here is the documentation in C# and here is what I tried, although something's wrong:
Dim list As New List(Of Message)
Public Function FetchUnseenMessages(ByVal hostname As String, ByVal port As Integer, useSsl As Boolean, ByVal username As String, ByVal password As String, ByVal seenUids() As String)
Using client = New Pop3Client
client.Connect("pop.mail.yahoo.com", "995", True)
client.Authenticate("xxxxxxx@yahoo.com", "xxxxxxx")
Dim uids As List(Of String) = client.GetMessageUids()
Dim newMessages As List(Of Message) = New List(Of Message)
For i As Integer = 0 To uids.Count Step 1
Dim currentUidOnServer As String = uids(i)
If Not seenUids.Contains(currentUidOnServer) Then
Dim unseenMessage As Message = client.GetMessage(i + 1) ' error here
newMessages.Add(unseenMessage)
End If
Next
End Using
End Function
I'm getting error whin trying to declare unseenMessage
as message and assign its value with client.getmessage(i+1).