hi, I wrote small code relate to email, one thing that i can't figure out how to write that code in php.

if member recieved hundred of junk email and they do not want to check all email, but if they want to check all of his freinds we can put email address and name of person on the text field for sample
John doe , john@email.com and store on the list or data lise.

however, when email system retreive new email and if email match with that email address then notify them that john@email.com has been arrived.

my question is that how can i write that code to match with new email from email address before notfiy the member that new email of person name arrived!

please help thanks.