Closed (duplicate)
Project:
Mime Mail
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2007 at 17:17 UTC
Updated:
9 Aug 2008 at 06:01 UTC
When passing the HTML $body text to the theme_mimemail_message() function what format should the URLs be in?
For example I have the following HTML markup in my message $body
<img src="/themes/bluebreeze/newsletter/wires.jpg" />
However when the newsletter is sent this image doesn't get encoded and included as part of the email- instead it shows up (as expected) as a broken image link in the mail reader.
Comments
Comment #1
kingandyI have this problem too - I'm using simplenews, with content generated by a rich text editor, and the sent newsletters still have the relative SRCs.
It is most aggravating.
Comment #2
hanskuiters commentedI also like the image to be encoded and included in the mail. A workaround I use now is change the link to the image link to the full url in the richtext editor (fck).
Comment #3
hanskuiters commentedI also like the image to be encoded and included in the mail. A workaround I use now is change the link to the image link to the full url in the richtext editor (fck). Using Drupal 5 and Simplenews 5.
Comment #4
kingandyThat's what I'd do if I was going to be the one writing the newsletters, unfortunately it has to be passed on to somebody who is less-than-conversant with HTML. :(
Comment #5
allie mickaI'm cautiously-optimistic that we fixed this in HEAD. If so, you'll see it in an upcoming 5.x release. If that doesn't work out for you, please reopen!
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
praseodym commentedIt doesn't work for me. Image tags are included without their full path and aren't embedded.
Comment #8
praseodym commentedA simple fix would be replacing the first few lines of theme_mail_message() by
Comment #9
berenddeboer commentedSame problem here. Don't understand it actually. The replacement trickery is in mimemail_extract_files(), and the pattern is ok, it finds the urls. But doesn't replace anything.
Comment #10
berenddeboer commentedOK, once I understood the code, here's how to make it work: use the full path from the root of your directory to the image. Assuming MIME mail will pick it up from your theme is wrong.
So a name like "test.png" won't work, but what will work is a thing like "sites/all/themes/mytheme/test.png" or "/sites/all/themes/mytheme/test.png"
So this can be closed; perhaps the documentation needs to be updated.
Comment #11
kingandyAre you sure that is the same issue? I can't think of anywhere that entering 'test.png' as the entirety of the image SRC would work at all, except in CSS files. The rest of this issue comes from people who have an image with a URL of "/sites/all/themes/mytheme/test.png" within a content item, but are not seeing their URL preceded with the base_href - or encoded within the MIME mail - when sent.
I'm going to mark this as active until somebody follows up on #8 above (I think it's probably bad form to mark things directly to 'closed' instead of 'fixed' anyway).
Comment #12
bletch commentedI am having the same issue. I tested #8 with no luck. Also applied patch (see #3) at [http://drupal.org/node/114312] and mime_url fix at [http://drupal.org/node/133107]. Nothing has worked.
I imagine that there are people successfully using images with tinymce and simplenews, but have yet to find someone.
Comment #13
praseodym commentedIt would be useful to be somewhat more descriptive; could you post the HTML output in the email for example? You might be having a different problem.
Comment #14
pvisser commentedThis is what did the trick ad my site.
Make a backup from the mimemail.module then edit the mimemail.module.
Search for the part :
------>
/**
* Themeable message body
*/
------>
Now this should work. Try on you own respons.
Comment #15
ericnielsen commentedI wanted my messages to have the images inline, attached to the e-mail, so I added this to the mimemail_extract_files function:
I'm not a PHP specialist. It works, but a better code would get the domain name and base path dynamically. The ideia is to attach all images located in my own site.
An option to "attach local images" in the settings page would also be welcome.
Greetings.
Comment #16
ericnielsen commentedI hope my comment was not "off topic". I'm suggesting here a new "feature" to this module.
Comment #17
allie micka@kingandy this is not an issue that I am able to reproduce. These types of images work properly in our test messages, and if that many images turned up broken, there would be more followers here.
So I'm not denying that this problem exists for you, but I do need to understand the root cause.
* Is your site hosted on its own domain ( e.g. www.example.org ) or in a subfolder? ( e.g. www.example.org/drupal )
* How do these images differ in format from any images that are working properly?
* Are you using I18N or other path-altering modules?
I'm tempted to apply the changes from #8, but I'd rather understand why this is happening for you and address it properly.
Comment #18
jerdavisBased on my investigation and testing, the patch being put together in http://drupal.org/node/291903 should likely resolve this. Once that issue is closed and the patch is committed please either wait for a new release to be generated (we're close!) or check-out from HEAD and give it a try. If you still have issues please let us know and provide as much detail as possible.