Search code examples
vb.netemailpop3

How can I configure EAGetMail DLL options to make date search work?


Hi everyone and thanks in advance for taking the time reading my question.

I have this scenario: I'm using EAGetMail DLL to retrieve emails from a POP3 e-mail server. I have used an example given on the website and so far so good; I can get all the emails from my inbox.

My problem arises when I try to use the data filters that the DLL provides, in order to not get all the emails in the inbox, just a few, using a certain data range.

The code that I'm using for this purpose is the following:

Dim oClient As New MailClient("TryIt")
    
oClient.Connect(oServer)
    
Dim options As GetMailInfosOptionType
options = options Or GetMailInfosOptionType.DateRange
options = options Or GetMailInfosOptionType.OrderByDateTime
        
oClient.GetMailInfosParam.Reset()
oClient.GetMailInfosParam.GetMailInfosOptions = options
        
oClient.GetMailInfosParam.DateRange.SINCE = System.DateTime.Now.AddDays(-4)
oClient.GetMailInfosParam.DateRange.BEFORE = System.DateTime.Now.AddDays(1)

Theoretically this should retrieve only the emails within last four days from today, but it is not working. Everytime I execute the code I get every e-mail from my inbox.

Has someone faced something similar to this?


Solution

  • The first sentence on this page, regarding the MailClient.GetMailInfosParam property, says that POP3 is not supported:

    Search email on IMAP4 Server and MS Exchange Server. It doesn't support POP3 protocol.