If your server supports UIDs then you should use those as some POP servers can change the order in which mails are numbered with the message ID between sessions regardless of whether the mail in the mailbox is deleted or not.
If UID values are not available then thoroughly test your server to make sure that the mails are always returned in the same order. Next thing to do is refactor your code so that you delete all your mails in one DELETE action rather than looping through and deleting them one at a time. This will bring two benefits. One, speed. Only one POP session is required to delete all the mails you need to and two, you don't need to worry about the mails being re-numbered as this only happens when you successfully disconnect from a POP server. HTH Paul ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198382 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

