added tips to lamer.bash help
[mirrors/Programs.git] / php / skripty / pop3test.php
CommitLineData
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
10if ($fp) { echo("GOOD CONNECTION\n"); }\r
11if (!$fp) { echo("BAD CONNECTION\n"); }\r
12\r
13$resp = (" ".fread($fp, 1000));\r
14echo($resp);\r
15if (strpos($resp, "+OK") != 0) { echo("GOOD SERVER\n"); }\r
16if (strpos($resp, "-ERR") != 0) { echo("BAD SERVER\n"); }\r
17\r
18fwrite($fp, "USER $user\n");\r
19$resp = (" ".fread($fp, 1000));\r
20echo($resp);\r
21if (strpos($resp, "+OK") != 0) { echo("GOOD USERNAME\n"); }\r
22if (strpos($resp, "-ERR") != 0) { echo("BAD USERNAME\n"); }\r
23\r
24fwrite($fp, "PASS $pass\n");\r
25$resp = (" ".fread($fp, 1000));\r
26echo($resp);\r
27if (strpos($resp, "+OK") != 0) { echo("GOOD PASSWORD\n"); }\r
28if (strpos($resp, "-ERR") != 0) { echo("BAD PASSWORD\n"); }\r
29\r
30if(fclose($fp)) { echo("CONNECTION CLOSED\n"); } else\r
31 { echo("CAN'T CLOSE CONNECTION\n"); }\r
32\r
33?>\r
This page took 0.361493 seconds and 4 git commands to generate.