You are going to have to use sockets and going to have to "speak" POP3. For instance to log in anc check your mail its
(+ Denotes server response)
+OK QPOP (version 2.51) at HOSTNAME starting
User username
+OK Password required for username
pass password
+OK username has 0 messages (0 octets)
(means you have 0 messages). So you will have to open a socket to the server you want. ($pop = fsockopen("server.com",110,30); the 30 is the timeout and the 110 is the port number). Once this is done you can write to the socket as a file. So
fputs("User username"); etc....
If you want to learn POP3 protocol language, the best place to learn would be the RFCs. Look at rfc1939
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1939.html
Hope this helps!