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 Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Re-JeeP Posted July 20, 2006 Author Share Posted July 20, 2006 No one? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.