Re-JeeP Posted July 19, 2006 Share Posted July 19, 2006 Hi!I want to create a telnet function with fsockopen.could someone get me a hint how to do it!?Best regards!//Johan Link to comment https://forums.phpfreaks.com/topic/15019-telnet-in-php/ Share on other sites More sharing options...
trq Posted July 19, 2006 Share Posted July 19, 2006 What do you want this function to do? Link to comment https://forums.phpfreaks.com/topic/15019-telnet-in-php/#findComment-60468 Share on other sites More sharing options...
Re-JeeP Posted July 19, 2006 Author Share Posted July 19, 2006 Hi!I want to se how many mails I've got on my mail-server.I come up wih the code below but it dosen't work![code]<?php function telnet_check_status($server, $port, $user, $pass) { $fp = fsockopen($server, $port, $errno, $errstr, 10); if(!$fp) { echo "Error: $errstr ($errno)<br />"; } else { $command = "USER ".$user."\r\n"; fwrite($fp, $command); $command = "PASS ".$pass."\r\n"; fwrite($fp, $command); $command = "QUIT\r\n"; fwrite($fp, $command); while(!feof($fp)) { $result .= fgets($fp, 128); } fclose($fp); } echo $result; }?>[/code]I get the folowing message:[quote="message"]+OK POP3 server ready (7.1.026.6) <7BDB52E280D9D910ED3F7A00A4BFD90EE706287D@pne-msproxy2-sn2.hy.skanova.net> +OK Password required -ERR [SYS/PERM] mailbox locked by a POP3 session[/quote]Any ideas? Link to comment https://forums.phpfreaks.com/topic/15019-telnet-in-php/#findComment-60627 Share on other sites More sharing options...
Re-JeeP Posted July 20, 2006 Author Share Posted July 20, 2006 No one? Link to comment https://forums.phpfreaks.com/topic/15019-telnet-in-php/#findComment-60877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.