Hi,
I can't figure out how to include images in the html mail. I tried to enclose refernce as background-image:url(''); in the css code, or embed it in the message as a html instruction, or in the footer or header - nothing worked. Any ideas?
Hi,
I can't figure out how to include images in the html mail. I tried to enclose refernce as background-image:url(''); in the css code, or embed it in the message as a html instruction, or in the footer or header - nothing worked. Any ideas?
Comments
Comment #1
Michsk commentedyou must upload them to a location, and call for them with url's, like http://www.yousite.com/sites/all/themes/yourtheme/images/img.jpg
Comment #2
jwilson3lasac is right, for images to appear, you must be sure you're referencing the image file absolutely as a fully qualified URI. I think there might be a feature request to change absolute paths (URLS starting with / and relative to webroot) into absolute URIs (including protocol://servername.tld:port/path/to/file.jpg), and if there is not, there should be :)
Also, you mention the CSS property
background-imagein your original post...Gmail and other email clients have been known to strip the CSS background properties even if you're inlining them (i.e.,
<div style="background-image:url(...)">) or using the emogrifier to embed them on the fly with class attributes. AFAIK, the only way to effectively use background images in HTML emails is inside the TABLE and TD tags, because they support the "background" attribute. Luckily, you can simulate bothbackground-imageandbackground-colorcss properties with ATTRIBUTES of the TABLE/TD tag.Interesting and unfortunate side note: the Emogrifier is currently not smart enough to turn css background properties that happen to be applied to TABLE or TD tags into their appropriate
backgroundorbgcolorattribute counterpart. :(Comment #3
NoahPollock commentedI am able to get an image into the header using html mail. However, I am unable to get an image to appear in the body of the emails. I am using the standard html code ie img src="http://www.website.com/image4.jpg" with brackets in both the template (header) and the body of the message. I have put input as "full html".
I am testing newsletter using gmail.
Any ideas?
Thanks!
Comment #4
Michsk commented- are you sure you are linking correctly to the image?
- have you checked in google the download images button?
may sound dumb questions but sometimes you look over them
Comment #5
NoahPollock commentedHi Isaac,
Yes - I do both. The images appear fine in the newsletter content - on the website, but not in the email - unless it is in the header...
Comment #6
Michsk commentedcheck the source of your recieved email, you will see what happends. I do not know how or even if its posible in google (can´t imagine its not posible). I do know its posible in outlook and thunderbird.
Comment #7
Christopher Herberte commentedComment #8
bryancasler commentedI have to re-open this.
To eliminate as many issues as possible I have disabled all the settings here admin/settings/htmlmail/settings
In my body text of a test email I placed the following.
The output in gmail with all setting options turned off
If I go back to the settings page and turn all options on, this is the output in gmail.
Comment #9
meishme commentedHas this issue been resolved?
I'm having problems similar to #5 were inline images do not appear at the emails, but appear at the website. Looking at the source code of the emails, there is no
tag at all... Like it disappears.
I also tried adding images via CCK. Same goes... They appear on the website, but not on the emails. Interestingly enough, the labels of the CCK fiels do appear on the emails, but no image.
Other tags (such as
<h1>,<h2>, etc) work perfectly fine. I don't believe it's input filter either as I've tested this over and over again... Plus the website version seems to display the items correctly.Comment #10
meishme commentedSorry guys, need to reopen this as it's still an issue.
Comment #11
thinkround commentedsame as #9. img tags do not show at all in email bodies...
At which point by which module/component are img tags removed?
Anyone? Any clue?
Comment #12
thinkround commentedfor me this issue has been resolved as I found that the img tags were filtered out by the simplenews module because the settings were on plain text emails. When I changed this to html all was fine.
Comment #13
pillarsdotnet commentedClosing as it appears the problem lies outside the htmlmail module.