Bug #67749 [NEW]: Multiple attachments are not coming to sent folder.. Only one is coming

From: Date: Sat, 02 Aug 2014 15:03:13 +0000
Subject: Bug #67749 [NEW]: Multiple attachments are not coming to sent folder.. Only one is coming
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186945@lists.php.net to get a copy of this message
From: devcoderz at yahoo dot com Operating system: Any PHP version: 5.4.31 Package: IMAP related Bug Type: Bug Bug description:Multiple attachments are not coming to sent folder.. Only one is coming Description: ------------ --- From manual page: http://www.php.net/function.imap-append --- I am trying to send an email with multiple attachments. Mail is going fine but in sent folder only one attachment is coming. I am using imap_append() to add it to sent box. There is no relevant documentation on multiple attachments...Please fix this if its a bug otherwise please suggest the solution.. Test script: --------------- if ($mbox=imap_open( $authhost, $user, $pass)) { $dmy=date("d-M-Y H:i:s"); $boundary = "------=" . md5(uniqid(rand())); $msg .= "From: ".$from[0]."\r\n" . "To: ".$recipients[$key][0]."\r\n" . "CC: ".$ccList."\r\n" . "Date: $dmy\r\n" . "Subject: $subject\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n" . "\r\n\r\n" . "--$boundary\r\n" . "Content-Type: text/html;\r\n\tcharset=\"ISO-8859-1\"\r\n" . "Content-Transfer-Encoding: 8bit \r\n" . "\r\n\r\n" . $body . "\r\n" . "\r\n\r\n" . "--$boundary\r\n" . "Content-Transfer-Encoding: base64\r\n"; foreach($attachment as $attchURL){ $files = $_SERVER['DOCUMENT_ROOT'] . "/attachments/" . $attchURL; $filename = substr($attchURL, strrpos($attchURL,"/")+1); $ouv=fopen ("$files", "rb");$lir=fread ($ouv, filesize ("$files")); fclose($ouv); $attachments = chunk_split(base64_encode($lir)); $msg .= "Content-Disposition: attachment; filename=\"$filename\"\r\n" ; $msg .= "\r\n" . $attachments . "\r\n"; } $msg .= "\r\n\r\n\r\n" . "--$boundary--\r\n\r\n"; imap_append($mbox,$authhost,($msg)); imap_close($mbox); } Expected result: ---------------- It should add multiple attachments to the mail in sent box. Actual result: -------------- It is only appending one attachment and not the other ones.. -- Edit bug report at https://bugs.php.net/bug.php?id=67749&edit=1 --

« previous php.bugs (#186945) next »