I've never done incoming. Its not built into standard PHP best I know.
Not sure of any premade scripts. PHP does have the IMAP
library which also works with POP3 and NNTP. You'll need to download an compile the C libraries for that though. Curl may be able to connect to a remote mail server and retrieve messages. The only incoming mail I've done was in Java.