string Net_NNTP::post (
string $subject
,
string $newsgroup
,
string $from
,
string $body
,
string $additional
)
ニュースサーバに記事を投稿します。
$subject
- 記事の Subject 。
$newsgroup
- 投稿先のニュースグループ。
$from
- 投稿者のメールアドレス。
$body
- 記事の本文。
$additional
- 追加するヘッダ。
string
- サーバからの応答。
エラー番号 | エラーメッセージ | 原因 | 対応方法 |
---|---|---|---|
NULL |
"Not connected"
|
ニュースサーバに接続するのを忘れてしまったか、あるいは 接続が閉じられてしまっています。 | post() を使う前に、まず接続を 開いて ください。 post() を使う前に、まず接続の状態を 調べて ください。 |
This function can not be called statically.
post() は、Subject や本文の文字コードを感知しません。 もし ASCII-127 以外の文字を使っている場合、正しいヘッダを設定することに 気をつけてください。
post() の使用
<?php
...
$subject = "Testpost";
$newsgroup = "php.test";
$body = "Le Mardi 12 f=E9vrier 2002, this is a test message using special french chars";
$from = "[email protected]";
$addheader = "Content-Transfer-Encoding: quoted-printable\n".
"Content-Type: text/plain; charset=ISO-8859-1;";
$response = $nntp->post($subject, $newsgroup, $from, $body, $addheader);
...
?>