Posting with php ... timeout

OlivierS teardrop at wanadoo.fr
Tue Jul 25 16:34:41 UTC 2000


Does anyone know how i could easily post a message using php ? ... i dont
want to use imap_mail cause it is very hard to install ...
I am trying with fsockopen but i have a problem : there is a timeout during
the post ...
Does anyone can explain me what is really a timeout here ?! php should be
enough quick to post the message ?!

Here is the log of the server :
Jul 25 16:52:30 my_serv nnrpd[1622]: client connect
Jul 25 16:52:31 my_serv nnrpd[1622]: client timeout in post
Jul 25 16:52:31 my_serv nnrpd[1622]: client group foo.foo 0
Jul 25 16:52:31 my_serv nnrpd[1622]: client times user 0.020 system 0.030
elapsed 1.230

Here is the php code :

$connection = fsockopen("my_serv",119, &$error_number,
&$error_description);
socket_set_timeout(200000);
fputs($connection,"mode reader\n");
fputs($connection,"group foo.foo\n");
fputs($connection,"post\n");
$fichier=fopen("/tmp/mail.txt","r");
while(!feof($fichier))
{
        $ligne=fgetss($fichier,255);
        fputs($connection,"$ligne\n");
}
fclose($fichier);
fputs($connection,".\n");
fclose($connection);




More information about the inn-workers mailing list