Delete POP3 Email Based on Date / Age?

Question:

Is it possible to delete email sitting on the POP3 server based on its age?
For example, have it only delete mail from server older than 5 days.

Answer:

The POP3 protocol itself does not have the direct ability to delete email based on date/time (or any other selection criteria).  The POP3 protocol only provides the ability to delete email based on a message ID.  Therefore, your application would need to download emails (or download headers-only), iterate over the emails, and for each email where the EmailDate (or LocalDate) property is old enough, call the MailMan.DeleteEmail method.

Tags :