PHP4 readin from pop3 mail box with fsockopen on port 110 (works), input the name and password and read the responses (works). List the entries (fine) DO an RETR on a number (fine) put in a while loop to read each of the entries. e.g. while(!feof($fd)) { echo fgets($fd,100); } as soon as it tries to read the last line it hangs. I have tried:using fread instead; searching for "\r\n"; doing a do/while; and lots beside. If I limit the while to less lines than there are its fine (this hardly practical however). It's just that last line. My next option is suicide. Any samaritans out there?
Hmmmmm.....interesting. I have an idea about this one, let me test my ideas out and I'll let you know if I'm stupid or not...
I wish PHP had a socket peek mechanism...
hey, I had the same problem with FTP
try this:
while(!strstr($fd,"Goodbye")) {
This while will execute until the connections echoes something like "Goodbye"