ID:               21778
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         Mail related
 Operating System: win2k
 PHP Version:      4.3.0
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Apart from providing the backtrace, you'll need to modify your script.

While versions of PHP prior to 4.3.0 allowed you to send mime encoded
emails entirely inside the header, this was *NOT* correct behavior. 
headers are only for headers, content belongs in the body.  Changes in
4.3.0 prevent data from being passed in this incorrect manner.

Granted it's exceedingly unlikely that this is causing apache to crash,
but it's also exceedingly unlikely that the script you've shown will
work on 4.3.0 at all, be the attachments large or small.  

Please ensure that you are:
(A) In fact using PHP 4.3.0 (Grabbing the latest stable snapshot from
snaps.php.net would also be a good idea)
(B) Sending header data in the header parameter and sending content in
the message patameter.

If, after trying the above, your application works fine, please return
and update your bug status as appropriate.  If not, please provide a
backtrace as described at top and also try to recreate the error from
the command line (using the CLI version of PHP) to isolate if this
error is apache related, or simply a mail() bug.


Previous Comments:
------------------------------------------------------------------------

[2003-01-20 11:28:09] [EMAIL PROTECTED]

$attachment['file_name'] = "a.doc";
$attachment['mime_type'] = "application/msword";
$attachment['description'] = "Request for On-Site Support";
$attachment['encoded_string'] =
CMS_file_get_contents("files/rfoss.b64",1); //returns the base64
encoded file as a string
        

$headers .= "From: ".$strFromName." <$strFrom>\r\n";
$headers .= "Reply-To:$strReplyTo <$strReplyTo>\r\n";
$headers .= "X-Priority: $intPriority\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$headers .= "Content-type: multipart/mixed;\r\n";
$headers .= "\t
boundary=\"SIMS------8f08ef19c30c5ab8bec2cd1a99c3578e\"\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n This is a MIME
encoded message\r\n\r\n"; 
$headers .= "--SIMS------8f08ef19c30c5ab8bec2cd1a99c3578e\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n\r\n"; 
$headers .= base64_encode($strMessage)."\r\n\r\n\r\n\r\n";
$headers .= "--SIMS------8f08ef19c30c5ab8bec2cd1a99c3578e\r\n";
$headers .= "Content-Type: ".$attachment['mime_type'].";
charset=iso-8859-1;\r\n";
$headers .= "\tname=".$attachment['file_name']."\r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Description:
".$attachment['description']."\r\n\r\n";
$headers .= chunk_split($attachment['encoded_string']."\r\n\r\n";
$headers .= "--SIMS------8f08ef19c30c5ab8bec2cd1a99c3578e--\r\n";

$bSent  = mail($strTo, $strSubject,"", $headers);

The code shown works perfectly when sending small attachments.

If I try to send an attachment more than a few kbytes in size it causes
apache to throw an error.

I have set php to use up to 20 mbytes of memory when executing a script
in the hope that it was a buffer overflow but to no avail.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21778&edit=1

Reply via email to