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?
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.
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.
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.
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 :/ .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With