added tips to lamer.bash help
[mirrors/Programs.git] / php / skripty / pop3test.php
1 <?php
2
3 $server = "pop3.seznam.cz";
4 $port = "110";
5 $timeout = "5";
6 $user = "harvie@seznam.cz";
7 $pass = "heslo";
8
9 $fp = fsockopen ($server, $port, &$errno, &$errstr, $timeout);
10 if ($fp) { echo("GOOD CONNECTION\n"); }
11 if (!$fp) { echo("BAD CONNECTION\n"); }
12
13 $resp = (" ".fread($fp, 1000));
14 echo($resp);
15 if (strpos($resp, "+OK") != 0) { echo("GOOD SERVER\n"); }
16 if (strpos($resp, "-ERR") != 0) { echo("BAD SERVER\n"); }
17
18 fwrite($fp, "USER $user\n");
19 $resp = (" ".fread($fp, 1000));
20 echo($resp);
21 if (strpos($resp, "+OK") != 0) { echo("GOOD USERNAME\n"); }
22 if (strpos($resp, "-ERR") != 0) { echo("BAD USERNAME\n"); }
23
24 fwrite($fp, "PASS $pass\n");
25 $resp = (" ".fread($fp, 1000));
26 echo($resp);
27 if (strpos($resp, "+OK") != 0) { echo("GOOD PASSWORD\n"); }
28 if (strpos($resp, "-ERR") != 0) { echo("BAD PASSWORD\n"); }
29
30 if(fclose($fp)) { echo("CONNECTION CLOSED\n"); } else
31 { echo("CAN'T CLOSE CONNECTION\n"); }
32
33 ?>
This page took 1.206039 seconds and 4 git commands to generate.