RE: [PHP] Trouble with fsockopen and pop server HELP!!!

From: Date: Wed, 01 Nov 2000 08:59:19 +0000
Subject: RE: [PHP] Trouble with fsockopen and pop server HELP!!!
Groups: php.general 
Request: Send a blank email to php-general+get-23123@lists.php.net to get a copy of this message
Hi David, I wrote a simple mail popper at http://pop.crash.nu The source is located at: http://pop.crash.nu/index.phps I hope this will help you a bit :) Grtz, dowebwedo Jeroen Wesbeek .programming St. Jacobsstraat 16 Postbus 448 | 3500 AK Utrecht The Netherlands p 030 2348110 | f 030 2348605 [roses are red, violets are blue, I am schizophrenic and so am I ] -----Original Message----- From: David Fordham [mailto:dfordham@summittech.com] Sent: woensdag 1 november 2000 5:38 To: php-general@lists.php.net Subject: [PHP] Trouble with fsockopen and pop server HELP!!! Hi all, I am trying to write a PHP program to open up a mail account on a POP server and move the mail to mail local machine for display on web (or whatever). The problem is that the POP server (and I have tried many) is not responding the way I expect based on what is in the RFC. The code is below: #!/usr/local/bin/php <?php $crlf = chr(13).chr(10); $stdOpen = "\n<html><title>PHP Test Mail interface</title><body>"; printf("$stdOpen"); $mailserver = "mail.summittech.com"; $fp = fsockopen ($mailserver, 110, &$errno, &$errstr, 30); if (!$fp) { echo "$errstr ($errno)<br>\n"; } else { $problem = "QUIT"; //$problem = "USER chrispin"; fputs ($fp, "$problem $crlf"); while (!feof($fp)) { echo fgets ($fp,128); } fclose ($fp); } ?> </body> </html> _________________ The mail server(s) only respond when $problem = QUIT and then it responds appropriately and quits, every other POP command issued hangs and I am at wits end on figuring out why. Help Please. David PS. I know that I could use the imap commands but, unfortunately, my ISP has not compiled PHP v 3.0.9 with the c client lib and "--with-imap" so those are not available to me. Thanks again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#23123) next »