Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #13444 problem in multipart mail with txt, html and images
Submitted: 2008-03-20 10:43 UTC
From: sbaldiss Assigned: alec
Status: Closed Package: Mail_Mime (version 1.5.2)
PHP Version: 4.3.4 OS: irrilevant
Roadmaps: 1.6.0RC1    
Subscription  


 [2008-03-20 10:43 UTC] sbaldiss (Simone Baldo)
Description: ------------ I have a problem like bug #9725... Sending a mail with txt part, html part and images generate a email with only html part visible (mail client Apple Mail) the structure of generated mail is: Content-Type: multipart/related; Content-Type: multipart/alternative; text version html version images I think that the correct order is: Content-Type: multipart/alternative; txt version Content-Type: multipart/related; html version images I suggest to correct the mime.php at line number 706 with this code: case $html AND !$attachments AND $html_images: if (isset($this->_txtbody)) { $message =& $this->_addAlternativePart($null); $this->_addTextPart($message, $this->_txtbody); $ht =& $this->_addRelatedPart($message); $this->_addHtmlPart($ht); for ($i = 0; $i < count($this->_html_images); $i++) { $this->_addHtmlImagePart($ht, $this->_html_images[$i]); } } else { $message =& $this->_addRelatedPart($null); $this->_addHtmlPart($message); for ($i = 0; $i < count($this->_html_images); $i++) { $this->_addHtmlImagePart($message, $this->_html_images[$i]); } } break; Test script: --------------- $crlf = "\n"; require_once('Mail/mime.php'); require_once('Mail.php'); $mime = new Mail_mime($crlf); $hdrs = array('Subject'=>'title', 'From'=>'email@example.com'); $mime->setTxtBody('hello world'); $mime->setHTMLBody('<html><body><img src="hello.jpg"></body></html>'); $mime->addHTMLImage('hello.jpg', 'image/jpeg', 'hello.jpg'); $body = $mime->get(); $hdrs = $mime->headers($hdrs, TRUE); Expected result: ---------------- A email with the structure: Content-Type: multipart/alternative; txt version Content-Type: multipart/related; html version images Actual result: -------------- A email with structure: Content-Type: multipart/related; Content-Type: multipart/alternative; text version html version images

Comments

 [2008-07-06 09:54 UTC] sbaldiss (Simone Baldo)
error with OSX server 10.4.11
 [2009-12-18 18:58 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Feedback -Assigned To: +Assigned To: alec
This conficts with http://pear.php.net/bugs/bug.php?id=9725. Will test more.
 [2009-12-30 16:52 UTC] alec (Aleksander Machniak)
-Status: Feedback +Status: Closed -Roadmap Versions: +Roadmap Versions: 1.6.0RC1
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.