3 $server = "pop3.seznam.cz";
6 $user = "harvie@seznam.cz";
9 $fp = fsockopen ($server, $port, &$errno, &$errstr, $timeout);
10 if ($fp) { echo("GOOD CONNECTION\n"); }
11 if (!$fp) { echo("BAD CONNECTION\n"); }
13 $resp = (" ".fread($fp, 1000));
15 if (strpos($resp, "+OK") != 0) { echo("GOOD SERVER\n"); }
16 if (strpos($resp, "-ERR") != 0) { echo("BAD SERVER\n"); }
18 fwrite($fp, "USER $user\n");
19 $resp = (" ".fread($fp, 1000));
21 if (strpos($resp, "+OK") != 0) { echo("GOOD USERNAME\n"); }
22 if (strpos($resp, "-ERR") != 0) { echo("BAD USERNAME\n"); }
24 fwrite($fp, "PASS $pass\n");
25 $resp = (" ".fread($fp, 1000));
27 if (strpos($resp, "+OK") != 0) { echo("GOOD PASSWORD\n"); }
28 if (strpos($resp, "-ERR") != 0) { echo("BAD PASSWORD\n"); }
30 if(fclose($fp)) { echo("CONNECTION CLOSED\n"); } else
31 { echo("CAN'T CLOSE CONNECTION\n"); }
This page took 1.206039 seconds and 4 git commands to generate.