Commit | Line | Data |
---|---|---|
8de51304 H |
1 | <?php\r |
2 | \r | |
3 | $server = "pop3.seznam.cz";\r | |
4 | $port = "110";\r | |
5 | $timeout = "5";\r | |
6 | $user = "harvie@seznam.cz";\r | |
7 | $pass = "heslo";\r | |
8 | \r | |
9 | $fp = fsockopen ($server, $port, &$errno, &$errstr, $timeout);\r | |
10 | if ($fp) { echo("GOOD CONNECTION\n"); }\r | |
11 | if (!$fp) { echo("BAD CONNECTION\n"); }\r | |
12 | \r | |
13 | $resp = (" ".fread($fp, 1000));\r | |
14 | echo($resp);\r | |
15 | if (strpos($resp, "+OK") != 0) { echo("GOOD SERVER\n"); }\r | |
16 | if (strpos($resp, "-ERR") != 0) { echo("BAD SERVER\n"); }\r | |
17 | \r | |
18 | fwrite($fp, "USER $user\n");\r | |
19 | $resp = (" ".fread($fp, 1000));\r | |
20 | echo($resp);\r | |
21 | if (strpos($resp, "+OK") != 0) { echo("GOOD USERNAME\n"); }\r | |
22 | if (strpos($resp, "-ERR") != 0) { echo("BAD USERNAME\n"); }\r | |
23 | \r | |
24 | fwrite($fp, "PASS $pass\n");\r | |
25 | $resp = (" ".fread($fp, 1000));\r | |
26 | echo($resp);\r | |
27 | if (strpos($resp, "+OK") != 0) { echo("GOOD PASSWORD\n"); }\r | |
28 | if (strpos($resp, "-ERR") != 0) { echo("BAD PASSWORD\n"); }\r | |
29 | \r | |
30 | if(fclose($fp)) { echo("CONNECTION CLOSED\n"); } else\r | |
31 | { echo("CAN'T CLOSE CONNECTION\n"); }\r | |
32 | \r | |
33 | ?>\r |