0 votes


How am I via VB filter specific dates? A range between 2 dates?
So far I have this code below but it takes for ever to loop through all e-mails and check dates.

        Dim builder As New MailBuilder()
        For Each uid As String In pop3.GetAll()

            Dim eml = pop3.GetMessageByUID(uid)
            Dim email As IMail = builder.CreateFromEml(eml)

            datum = email.[Date]
            If Year(datum) = 2018 And Month(Now) = 11 Then

Please advise, thank you SOO much!!


1 Answer

0 votes

POP3 protocol doesn't have any kind of searching capability.

I strongly suggest using IMAP.

You'll get searching:

Pretty fast most common email fields retrieval:

If you are stuck with POP3 for some reason:
- You can use GetMessageHeadersByUID to download email headers only (no attechements and body will be downloaded) and identify messages you should download in full.
- GetAll returns messages in order, so you could probably made some guesses on the date of the messages.

by (295k points)