Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including background image with CID

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?

like image 872
Chris Avatar asked Apr 23 '12 08:04

Chris


People also ask

How do you add a background image to coding?

The most common & simple way to add background image is using the background image attribute inside the <body> tag. The background attribute which we specified in the <body> tag is not supported in HTML5. Using CSS properties, we can also add background image in a webpage.

How do I put an image as a background in HTML email?

Click Email templates. Click Create Template. Click the Code your own tab, and select Paste in code. In the Code Editor, insert the following code just after the opening <body> tag to add the placeholder background image and color.

What does CID mean in email?

Content-ID (CID) is one of the oldest practices for embedding images into marketing emails. CIDs involve attaching the image to the email and referencing it with HTML tags in the email's template, which embeds the image when the email is opened.


Video Answer


1 Answers

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 :/ .

like image 155
negora Avatar answered Oct 13 '22 02:10

negora