problem with fsockopen and lenght of fputs
| From: | Philippe | Date: | Tue, 07 May 2002 14:29:00 +0000 |
| Subject: | problem with fsockopen and lenght of fputs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-96436@lists.php.net to get a copy of this message | ||
Hello everyone,
I'm trying to send Email with fsockopen. It works fine but when the body of the message is superior to 8k. Then the fputs didn't work.
I've read that the fputs had a buffer of 8k and we must use set_file_buffer to remove buffer. But it seems not to work on a fsockopen.
Is there an solution to increase the size of buffer for a socket ??
Here's my code :
$message="EHLO ".$nom_serveur.chr(13).chr(10);/
$message.="MAIL FROM:<".$exp.">".chr(13).chr(10);
$message.="RCPT TO:<".$to.">".chr(13).chr(10);
$message.="DATA".chr(13).chr(10);
$message.="Date: ".date("r").chr(13).chr(10);
$message.="Subject: ".$subject.chr(13).chr(10);
$message.="From: ".$exp.chr(13).chr(10);
$message.="Reply-To: ".$reply.chr(13).chr(10);
$message.="To: ".$to.chr(13).chr(10);
$message.="Mime-Version: 1.0".chr(13).chr(10);
if ($type='text')
$message.="Content-Type: text/plain;";
else
$message.="Content-Type: text/html;";
$message.=" charset=\"iso-8859-1\"".chr(13).chr(10);
$message.="Content-Transfert-Encoding: 8bit".chr(13).chr(10);
$message.=chr(13).chr(10);
$message.=$msg.chr(13).chr(10);
$message.=".".chr(13).chr(10);
$message.="QUIT".chr(13).chr(10);
$fd=fsockopen($ip_serveur,25);
fputs($fd,$message,strlen($message));
fclose($fd);
Thanks for your response,
Best regards.
Philippe BARRIELLE
Sce Informatique
---------------------------------------------------------------------------------------------------
* S.A. Editions et Publicites - ABRITEL *109, La Canebière - B.P 2033 - 13201 Marseille cedex 01 - France
Tél : 33 (0)4 91 11 00 72 Wap : http://wap.abritel.fr Email: pbarrielle@abritel.fr Web : http://www.abritel.fr---------------------------------------------------------------------------------------------------
LOCATIONS VACANCES - FRANCE - SPAIN - DOM - PORTUGAL---------------------------------------------------------------------------------------------------