开发者

PHP and NNTP problems using imap_open

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.


Have you tried changing

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

To

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

This worked when connecting to my newsserver.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜