Simplenews Embedded Images Not Displayed/Attached
intrafusion - May 1, 2009 - 15:58
| Project: | Mime Mail |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
When used in conjunction with Simplenews, images which are added to either simplenews-newsletter-body.tpl.php or simplenews-newsletter-footer.tpl.php are being embedded into the message with a src of cid:1be6693408de7c23aefde4a65ff51439@www.domain.com etc but these images are not being displayed or attached to the e-mail.
Strangely however, images which are added to the body of the content created in Simplenews are being displayed correctly using the full URL supplied. This used to work OK until I updated to the newest version of Mime Mail recently.

#1
Maybe this is related - but doesn't help much:
http://drupal.org/node/374811
I found more info here and posted a "quick fix" (I had the same problem as described above):
http://drupal.org/node/436706#comment-1530848
#2
Am getting something very similar, however I can't find a pattern for which images work and which don't (and it is not size, and it is not image type).
#3
I tried applying mindgames' quick fix reported at http://drupal.org/node/436706#comment-1530848, which I repeat here to keep the thread clean:
to this version:
/* $Id: mimemail.inc,v 1.31.2.3 2009/04/14 23:08:59 jerdavis Exp $ */Now when I send the newsletter nothing arrives but the title !
So I applied the fix for mangling of HTML headers as reported here: http://drupal.org/node/438058, http://drupal.org/node/387462
//ORIG $subject = mime_header_encode(drupal_html_to_text($subject));$subject = mime_header_encode($subject);
And still when I send the newsletter nothing arrives but the title !
So now I am rather frustrated. Could somebody please patch things up and provide a mimemail that neither mangles HTML titles nor makes any images disappear ?
#4
I checked out the latest from HEAD and now the newsletter arrives as text only, with long URLs for all links etc.
#5
Ok, after days (!!!) of trying different versions I have managed to send a clean newsletter, and I seem to have found the cause of my problems, although I don't understand what I have seen at all. I am working with:
/* $Id: mimemail.inc,v 1.40 2009/02/23 16:11:19 jerdavis Exp $ */Firstly, the problem reported above at May 16, 2009 - 11:17 'now the newsletter arrives as text only' was a furphy, somehow when I installed a new version of Mimemail the newsletter option for HTML/'plain text' reset and so of course the Newsletter arrived in plain text.
I explored the problem with some images by starting a fresh newsletter. Because I am using Composite to manage my newsletter layout, I was able to build up the newsletter cell by cell to find which ones contained an image that provoked the problem. It seemed to be caused by images with names that had more than one period '.' character, like image.bw.png, which gave rise to the src attribute in the img tag taking the value
Array(). The same occurred for images with underscore '_' and/or hiphen '-', so I renamed all of those images to only use alphabetical characters and to have a clear suffix like .png or .jpg or .gif.Strangest of all, when an image was causing a problem, it also seemed to cause problems with other images that had otherwise arrived just fine when used alone !
One of the most annoying, frustrating, time-wasting, cryptic, and absolutely hair-greying bugs (dare I say "feature nuance") I have ever encountered in 30 years of programming. What a week. At least now I have a way of working and resuming progress towards delivering my newsletter to recipients, even if I am none the wiser.
I remain most grateful to the developers of Simplenews; please though look into this problem and solve it before anybody else suffers further hair loss.
#6
PS: The Composite newsletter can be viewed at http://www.webel.com.au/newsletter
#7
PPS: my problems had started with the following version:
mimemail.inc,v 1.31.2.2 2009/02/22 01:58:24 jerdavisWhich I had used without image problems (but indeed with title-problems, since they were treated as HTML and newlines inserted) for the following newsletter:
http://www.unseentv.tv/content/unseen-tv-newsletter
And because that newletter had used images and Composite layout and sent ok, I was all the more confused as to why my own newsletter would fail for some images only.
#8
Webel, thanks for your work on this and putting together a nice issue report. It's going to help me send newsletters (if I can find a version of mimemail which doesn't break the mail functionality of my site completely).
#9
Latest update, I can now send a Composite newsletter ok to Thunderbird mail client, to Yahoo!Mail, and to Hotmail, but for some reason some (only) images are not visible on GMail, (Google Mail), and I can't see how to get at the page or frame source on gmail, so I'm none the wiser. May or may not be a Mimemail issue.
#10
Hello all,
I found this thread because I was having a similar problem using Notifications & Messaging. Images would embed when the number of subscribers was limited to single digits (never found the exact limit) but would fail when sending to my entire ~7000 user base. After much tweaking of settings for both php limits and in the process limits of Notifications & Messaging, I finally found the answer while considering using PHPMailer instead (which I'm going to do any as the output is cleaner).
Pathologic!
What MimeMail really doesn't seem to like is relative paths. By adding Pathologic to the input filter used by MimeMail, all the images appeared!
Hope that helps someone!
Oh, also, if you're using a wysiwyg editor that outputs links with a leading / (ie - /sites/default/files/image.jpg), you need to config Pathologic to recognize / as a local path as described here: http://drupal.org/node/298558#comment-986128
#11
Are you saying that installing Pathlogic solved the problem of images not showing up when when you send to hundreds+ subscribers? I don't see how the two are related. What would happen if in your WYSIWYG you just manually entered the full path/url to the image? Would the image still fail when sending to lots of addresses?
I am trying to solve the mystery of why the images show up in the test email messages whether the full path is included or not, but when sent to the full list the images are not included.
#12
It seemed that with relative URLs, the img src links looked like this:
<img src="cid:05513085cc873adef711fa591faa4d9f@domain.com" />After adding Pathologic, they appear as
<img src="http://domain.com/sites/default/files/file.png" />I hadn't tried authoring a node with an image defined as an explicit URL and won't have the chance as I have now ditched MimeMail in favor of PHPMailer (which also had missing images until I installed Pathologic).
#13
Can PHPMailer be used in place of Mime Mail when using Simplenews? The Simplenews page doens't mention PHPMailer.
Whoops. Never mind. I see PHPMailer can be used in conjunction with Mime Mail.
#14
I don't think so. I was using the Notifications and Messaging modules. The messaging framework has several options, Mime Mail and PHPMailer among them.
#15
My images are arriving in my mail with relative links and so don't show as broken links...
I can't determine if this is a glitch or setting issue? Any ideas?
I'm using Drupal 6 / latest simple news/ HTML mail module / SImple news patch for HTML MAIL module
#16
This looks like it will fix my issue of relative images links in Emails...
Okay so two things helped me with my issue of broken email images in newsletter emails.
I chose to use the module absolute src module drupal.org/project/abssrc but also I had to make sure imagebrowser setting let apache serve the images and not Drupal.
I chose this over pathlogic module becuase its still in beta.
Perhaps this will help some one.