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

Bug #10158 Inline images not displayed on Mozilla Thunderbird
Submitted: 2007-02-22 12:51 UTC
From: pedro at malditorodriguez dot org Assigned: cipri
Status: Closed Package: Mail_Mime (version 1.4.0a1)
PHP Version: 5.2.0 OS: Any
Roadmaps: 1.4.0, 1.4.0a2    
Subscription  


 [2007-02-22 12:51 UTC] pedro at malditorodriguez dot org (Pedro)
Description: ------------ Using the function addHTMLImage, for emmbebed images, the recipient recieves the email but the image isn't showed. Instead, a white square with a X is showed. This only ocurrs for Thunderbird (and I think for evolution too), but not with outlook clients, where is showed correctly. Test script: --------------- $file = 'dib.jpg'; $html = '<html><body><img src="' .$file .'"></img></body></html>'; $crlf = "\n"; $hdrs = array('From' => 'me@mydomain.org', 'Subject' => $asunto); $mime = new Mail_mime($crlf); $mime->setTXTBody($text); $mime->addHTMLImage ($file, 'application/octet-stream'); $mime->setHTMLBody($html); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory('mail'); $mail->send($dest, $hdrs, $body); Expected result: ---------------- A email with a HTML page with an emmbebed image Actual result: -------------- A email with a HTML page without images, but attached.

Comments

 [2007-03-08 00:33 UTC] cipri (Cipriano Groenendal)
DO you have a piece of mailbody that shows the problem to me? Everythig works fine over here.
 [2007-03-08 17:22 UTC] cipri (Cipriano Groenendal)
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. Please try the new Mail_Mime 1.4.0a1 package as it contains a lot of fixes.
 [2007-03-09 11:05 UTC] pedro at malditorodriguez dot org
I have installed the new package version, but I have the same problem.
 [2007-03-17 15:54 UTC] cipri (Cipriano Groenendal)
Try changing the 'application/octet-stream' to 'image/jpg', and see if that helps? I don't have thunderbid, but I do have some test emails from TB, all of which feature an 'image/<something>' tag. Please let me know if that helps.
 [2007-03-19 09:23 UTC] pedro at malditorodriguez dot org
Fantastic, that was the problem. Thank you very much!!!
 [2007-05-05 15:06 UTC] cipri (Cipriano Groenendal)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Mail_Mime Fixed in 1.4.0
 [2007-07-19 20:33 UTC] jlang (Jeff Lang)
I'm experiencing the same problem as pedro. Using Thunderbird as my email client and inline images will not display (in my case, the alt text does). The same thing happens if I check in Gmail, but not in Outlook 2007. Using: Mail 1.1.9 Mail_Mime 1.5.2 (stable) Mail_MimeDecode 1.5.0 (stable) I can send you the message body (offline) if you want, but I don't want to post it because of email addresses. I have tried adding the images as 'image/gif', 'application/octet-stream' and the default content type (no parameter). Thanks in advance
 [2007-07-20 15:21 UTC] jlang (Jeff Lang)
The problem boils down to the "src=<filename>" part of the HTML body. My HTML code references the files relatively (ie "image.gif") and Mail_Mime::get() loops over _html_images, to replace with the cid value, by looking for a fully qualified path (ie "/home/public_html/image.gif"). Personally, I think it's worth adding code to look for a relative path, but if not that sort of thing belongs in the documentation. Thanks for all of your hard work on this useful tool.
 [2009-08-14 13:13 UTC] tck (Tobias Knab)
Patch for inline images in thunderbird: Index: mime.php =================================================================== --- mime.php (Version 1.5.2) +++ mime.php (Fix) @@ -530,6 +530,7 @@ $params['disposition'] = 'inline'; $params['dfilename'] = $value['name']; $params['cid'] = $value['cid']; + $params['location'] = $value['name']; $ret = $obj->addSubpart($value['body'], $params); return $ret;