Question:
I have been working with one of your examples to get the most recent emails received on the POP account by using the mailman.GetUidls. I have this process on a timer so it calls GetUidls every 30 seconds or so. If I receive a new email within the 30seconds, the mailman.GetUidls isn’t reflecting it. I have to stop my app and start it again. It appears that the mailman object isn’t refreshing its data with the subsequent calls to GetUidls. I tried calling mailman.Pop3BeginSession hoping that would reset it but have not had any luck. Do you have any idea what I might need to do to refresh the mailman object to properly get GetUidls to work?
Answer:
You need to call Pop3EndSession(), which causes the component to end the POP3 session and disconnect. The next method call will automatically re-connect and start a new session, and you’ll see the full set of UIDLs. The POP3 protocol is such that when your program connects, it gets a snapshot of the UIDLs in the mailbox. Any emails added or deleted will not modify the snapshot. If your program re-asks for the complete set of UIDLs at any point within the POP3 session, it will receive the same snapshot of UIDLs that existed at the beginning of the session.