Re: problem with fsockopen and lenght of fputs

From: Date: Tue, 07 May 2002 18:35:22 +0000
Subject: Re: problem with fsockopen and lenght of fputs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-96473@lists.php.net to get a copy of this message
On Tue, 7 May 2002, Philippe wrote: > 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 ?? How about just pushing 8K at a time? $bytes_sent = 0; $chunk_size = 8192; while ($bytes_sent < strlen($message)) { fwrite($fp, substr($message, $bytes_sent, $chunk_size)); $bytes_sent += $chunk_size; } miguel

« previous php.general (#96473) next »