Jump to content

Telnet in php


Re-JeeP

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.