Hi Andrea,
You can identify the new message on Pop3 by both MailMessage.MessageID and Pop3MessageInfo.UniqueID.
If you use Pop3MessageInfo.UniqueID, it will run faster but the whole message would not be downloaded. You will just get the basic info like UniqueID, sequence number, subject etc.
If you use MailMessage.MessageID, you need to first fetch the message from Pop3 server by calling FetchMessage(int sequencenumber).
Since, you already have saved MessageID in your DB, you need to create a new field for “UniqueID” and update this field with the valid UniqueID from the Pop3 server. You can easily map the UniqueID with the MessageID.
The Pop3Client.ListMessage() returns Pop3MessageInfoCollection. Do a foreach on this collection to get the UniqueID and sequence number. You have got the sequence number. Now call FetchMessage() and give sequence number as parameter. FetchMessage() will return you object of type MailMessage. And you can get the MessageID from this object. Once you have this map saved somewhere in the DB table or in hashtable etc, you can update the existing records according to the map.
There might be some messages which are deleted from pop3 server, but they exists in the DB. For such message, you can create GUID and update the UniqueID field.
You may also find this technical tip ([http://www.aspose.com/documentation/utility-components/aspose.network-for-.net/detecting-new-email-messages-on-pop3-server.html ](http://www.aspose.com/documentation/utility-components/aspose.network-for-.net/detecting-new-email-messages-on-pop3-server.html)
) useful. Sample code is given for Aspose library usage and pseudo-code for DB usage.