Retrieve E-mail from server (pop3) by date for filtering on subject or body in C#
Posted
by
Josh
on Stack Overflow
See other posts from Stack Overflow
or by Josh
Published on 2010-12-29T16:35:48Z
Indexed on
2010/12/29
16:54 UTC
Read the original article
Hit count: 159
I have a piece of monitoring software I am writing which needs to retrieve e-mails sent to an address for a certain day so that I can filter them by a regex in the subject or body. I don't need to retrieve the entire message, only the subject and body for all messages on a given day so that I can evaluate them with a regular expression for a token.
I looked at EAGetMail as a solution, but their implementation doesn't do what I need to to do. I can only get all information on mail, which only has the size and index. I would need it by subject, but even then I don't want to get everything in inbox. If I went with this solution I have to get all mail, and then retrieve each mail message individually to evaluate the subject and body. This is not ideal.
I also looked at OpenPop.Net, but it too does not have a targeted retrieval for today's messages only.
Can I even do what I want without looping through every single email on the server until I find a match? What is the best way to accomplish what I am trying to do? Am I going to have to build a custom web request to get the data I want? Also, I looked at Chilkat, but I am looking for a free solution, even if it means building the http request myself.
© Stack Overflow or respective owner