#21778 [NEW]: Mail Function causes apache to throw an error when sending mails with large att

From: Date: Mon, 20 Jan 2003 17:28:09 +0000
Subject: #21778 [NEW]: Mail Function causes apache to throw an error when sending mails with large att
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30690@lists.php.net to get a copy of this message
From: adrian@sourceconsulting.co.za Operating system: win2k PHP version: 4.3.0 PHP Bug Type: Apache related Bug description: Mail Function causes apache to throw an error when sending mails with large att $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 bug report at http://bugs.php.net/?id=21778&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21778&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21778&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21778&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21778&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21778&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21778&r=support Expected behavior: http://bugs.php.net/fix.php?id=21778&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21778&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21778&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21778&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21778&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21778&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21778&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21778&r=gnused

« previous php.bugs (#30690) next »