note 16030 added to function.fsockopen
| From: | steve at php2 dot chek dot com | Date: | Sat, 13 Oct 2001 13:23:07 +0000 |
| Subject: | note 16030 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18876@lists.php.net to get a copy of this message | ||
I have a code. You can retrieve your email with this. Sockets can retrive POP3 and NNTP but not
IMAP.
$port=110;
$user="";
$pass="";
$fp=fsockopen("pop.server.com", $port);
$tmp=fgets($fp, 1024);
fputs($fp, "USER ".$user);
$tmp=fgets($fp, 1024);
fputs($fp, "PASS ".$pass);
$tmp=fgets($fp, 1024);
fputs($fp, "RETR ".$num);
$tmp=fgets($fp, 1024);
echo $tmp;
echo "<a href=$PHP_SELF?num=$nxtn>Next</a>";
$num comes from the address bar like http://domain.com/mailbox.php?num=1
--
http://www.php.net/manual/en/function.fsockopen.php
http://master.php.net/manage/user-notes.php?action=edit+16030
http://master.php.net/manage/user-notes.php?action=delete+16030
http://master.php.net/manage/user-notes.php?action=reject+16030