Bug #67749 [Opn->Nab]: Multiple attachments are not coming to sent folder.. Only one is coming

From: Date: Sat, 29 Aug 2015 12:03:41 +0000
Subject: Bug #67749 [Opn->Nab]: Multiple attachments are not coming to sent folder.. Only one is coming
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195628@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67749&edit=1 ID: 67749 Updated by: cmb@php.net Reported by: devcoderz at yahoo dot com Summary: Multiple attachments are not coming to sent folder.. Only one is coming -Status: Open +Status: Not a bug Type: Bug Package: IMAP related Operating System: Any PHP Version: 5.4.31 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2014-08-02 15:03:12] devcoderz at yahoo dot com 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 this bug report at https://bugs.php.net/bug.php?id=67749&edit=1

« previous php.bugs (#195628) next »