12

I need to embedd an image into an HTML mail. The image itself is already working and embedded into the mail as it is supposed to but there is one problem: The pic is shown via : <img src="cid:cidname" width="550" height="95" /> but not with:

<div id="head" style="width:550px; height:95px; margin-bottom:0px; background-image:url(cid:cidname); background-repeat:no-repeat;"></div>

Anyone got an idea what might cause the problem?

Chris
  • 1,226
  • 1
  • 12
  • 26
  • Would you happen to be using a recent Microsoft email client? http://www.campaignmonitor.com/css/ suggests `background-image` is not supported in the latest versions of Outlook and Hotmail. – eggyal Apr 23 '12 at 08:27
  • Im currently testing with Thunderbird v.11.0.1. Already had a look at this, but thanks anyway. – Chris Apr 23 '12 at 08:29
  • Well since i needed it until today i just used for now, buf if someone has an idead, im still happy to hear about it ;) – Chris Apr 24 '12 at 10:34

2 Answers2

5

Your syntax is right. Or at least that's the method supported by many mail clients to use embedded images into the CSS "background-image" attribute.

However, if you're testing this in Mozilla Thunderbird , you won't be able able to watch the images because of an historical bug or lack of support for this feature. There is a bug report opened here: https://bugzilla.mozilla.org/show_bug.cgi?id=254015#c21 .

If you're interested on this feature, I recommend you to vote for it. It has almost passed 10 years since it was opened :/ .

negora
  • 151
  • 1
  • 3
  • 4
  • I don't get it how such obvious bugs are carried along for that long … Is there any workaround / best practice for Thunderbird? I've incuded it with the table background attribute but those backgrounds seems to get lost when answering or forwarding … – GDY Jan 30 '20 at 09:19
0

Yup. I want this to work too. So tired of microshaft blocking images. Actually this bug is 19 years old now! https://bugzilla.mozilla.org/show_bug.cgi?id=154836