tags:

views:

30

answers:

2

Hi guys, I have another one problem with pop3. Here is connection to pop3-server:

$pop3Server = '62.113.86.215';  // mail.roller.ru
$pop3User = 'mail-robot%roller.ru';

$pop_conn = fsockopen($pop3Server, 110, $errno, $errstr, 30);
echo fgets($pop_conn, 1024);

It returns OK. The next step is login:

fputs($pop_conn, 'USER '.$pop3User.'\r\n');
//stream_set_timeout($pop_conn, 3);
print fgets($pop_conn, 1024);

And I get time-out. Why?

p.s. Here is full code: http://pastie.org/934170

+1  A: 

'\r\n' should be "\r\n". http://php.net/types.string

Col. Shrapnel
A: 

There are libraries to do that kind of stuff. Take a look, for example, at here: http://phpmailer.worxware.com/index.php?pg=examplebpop

VDVLeon