23 pers. connectées au site
Manuel Pear
Net_NNTP::post()
Net_NNTP::post() -- post a message
Synopsis
- <?php
- require_once 'Net/NNTP.php
- ?>
string Net_NNTP::post (string $subject, string $newsgroup, string $from, string $body [, string $additional])
Description
Post a message to a news server
Paramètres
-
$subject - Subject of the message
-
$newsgroup - Post to this newsgroup
-
$from - EMail adress of sender
-
$body - Body of the message
-
$additional - String of headers to add
Valeur retournée
string - Server response
Valeurs renvoyées
Tableau 54-1. Valeurs PEAR_Error possibles
| Error code |
Error message |
Reason |
Solution |
| NULL |
"Not connected" |
You forgot the set up a connection to a news server or the connection was already again closed. |
Open a connection before using post(). Check the connection status before using post(). |
Note
Cette fonction ne peut pas être appelée de façon statique.
| Avertissement |
|
post() doesn't care about character encoding of subject and body. Make sure to set correct headers, if you are using non ASCII-127 characters.
|
Exemple
Exemple 54-1. Using post()
- <?php
- ...
-
- $subject = "Testpost";
- $newsgroup = "php.test";
- $body = "Le Mardi 12 f=E9vrier 2002, this is a test message using special french chars";
- $from = "test@example.com";
- $addheader = "Content-Transfer-Encoding: quoted-printable\n".
- "Content-Type: text/plain; charset=ISO-8859-1;";
-
- $response = $nntp->post($subject, $newsgroup, $from, $body, $addheader);
- .
- ?>
|
Remonter