My problems with Net_NNTP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I always get error messages regarding the "from" address field even
though it looks correct to me, e.g. says "posting failed - invalid from" says "Posting Failed ("From" Header not in Internet

PHP 5.0.5
Net_NNTP 1.1.2

Full Code:

require_once 'Net/NNTP/Client.php';

$nntp = new Net_NNTP_Client();



$subject   = "Testpost";
$newsgroup = "alt.binaries.test";
$body      = "test";
$from      = "";

$response = $nntp->post($subject, $newsgroup, $from, $body);



Re: My problems with Net_NNTP

On 9 Oct 2005 23:38:28 -0700, wrote:

Quoted text here. Click to load it

 You've got the parameters in the wrong order.

     * Post an article to a number of newsgroups.
     * (Among the aditional headers you might think of adding could be:
     * "NNTP-Posting-Host: <ip-of-author>", which should contain the IP-address
     * of the author of the post, so the message can be traced back to him.
     * Or "Organization: <org>" which contain the name of the organization
     * the post originates from)
     * @param string $newsgroups The newsgroup to post to.
     * @param string $subject The subject of the post.
     * @param string $body The body of the post itself.
     * @param string $from Name + email-adress of sender.
     * @param optional string $aditional Aditional headers to send.
     * @return mixed (string) server response on success or (object) pear_error
on failure
     * @access public
    function post($newsgroups, $subject, $body, $from, $aditional = null)
        return $this->cmdPost($newsgroups, $subject, $body, $from, $aditional);

Andy Hassall :: :: :: disk and FTP usage analysis tool

Re: My problems with Net_NNTP

Andy Hassall wrote:
Quoted text here. Click to load it

Thanks Andy, I had copied the faulty code from Example 46-1:

Didn't notice it was deprecated :)

Site Timeline