0

I am having a bit of trouble with NNTP and PHP (following the directions in the PHP manual, I threw in this quick test:

<?php
$server = "{news.newsserver.com/nntp:119}";
if ($nntp = imap_open($server,"myuser","mypass", OP_HALFOPEN)) {
    echo "Connected...\n";
    $list = imap_list($nntp, "{news.newsserver.com}", "*");
    if (is_array($list)) {
        foreach ($list as $val) {
            echo imap_utf7_decode($val) . "\n";
        }
    } else {
        echo "No groups found...\n";
    }
} else {
    echo "Unable to connect...\n";
}

When I run this script I get:

Connected... 
No groups found...
>

Any suggestions would be most appreciated. I am connecting to a valid server with a valid username and password. I am also aware of the Net_NNTP PEAR library, but I am at this point not interested in using that rather I just want to use whats 'build_in'ish to php.

Aaron Murray
  • 1,920
  • 3
  • 22
  • 38

1 Answers1

1

Have you tried changing

$list = imap_list($nntp, "{news.newsserver.com}", "*");

To

$list = imap_list($nntp, $server, "*");

This worked when connecting to my newsserver.

vstm
  • 12,407
  • 1
  • 51
  • 47
  • very interesting, I am sure that I was reading different (can't recall if it was a website or the php manual at the moment), but yeah, that apparently works, thank you, I was starting to worry that I was going to have to build my own library with sockets *or* use the Net_PEAR library, but thank you, it works! – Aaron Murray Aug 27 '11 at 01:32