fsocketopen can also be used to connect to a pop3 and IMAP server but theres no predfeined mail functions like with IMAP so you have to code the parts that connect to the server, get the mail, get the folders, parse the data, display the data, and abilities like delete, new and old mail and so on, and also to close the connection.
As you can see, using fsocket is alot more work but is more compatible with servers.
http://www.php.net/manual/en/function.fsockopen.php