Hello, I am fetching mails from gmail and imap_fetch_overview function returns array of message information along with message_id that is only the unique thing to identify message identity. But for some mails it is blank. So how can I preserve unique identity of the messages as I am storing them in database. Please help me. Thanks in advance.
Would a column in your database with an AUTO_INCREMENT ie. a primary key not be enough? Maybe you could create a column to store the MD5 of the time/subject of each message.
Thanks for your reply. actually what i am doing over here is that i am storing particular mails into database and i want to preserve the identity of each mail as i will be comparing them in the database whether they are stored already or not. And I will need a unique identifier for that in order to remove duplicates. So, how can I do this without messege_id?
Try to create md5 of headers/body and store it in your database. This should help to differentiate each email.
Yes, store the MD5 of various headers/body of each email in a column in your database and use that as the 'real' unique identifier. You can then add a UNIQUE key on that column, so when you insert emails in to the database (with the MD5) you stop any duplicates.