background image is not send as embedded

Discussion of bugs in Mozilla Thunderbird
Locked
User avatar
jaison.daniel
Posts: 2
Joined: August 22nd, 2007, 6:52 am
Contact:

background image is not send as embedded

Post by jaison.daniel »

I have an email HTML signature that contains a background image and a normal image. In tunderbird1.5.x both images sent as a embedded But in tunderbird 2.x(2.0.0.6) the normal image sent as a embedded and the background image not sent as embedded instead of it sent as a plain text(the url).
Is there any configuration need to enable that or its a bug?
My Signature Code:
-----------------------------------------------------------------------------------------------
<table>
<tbody>
<tr>
<td valign="middle" width=120><a href="http://www.sun.com">
<img border=0 src="file:///F:/doc/mail/Signature/images/SunBlue.gif"></a>
</td>
<td nowrap="nowrap" valign="middle" background="file:///F:/doc/mail/Signature/images/SunJava.gif" class="bg">
<b>J Jaison Daniel, M.S.,</b><br>
Member Technical Staff<br><br>
</td>
</tr>
</tbody>
</table>
-----------------------------------------------------------------------------------------------

But the receiver received as follows
-----------------------------------------------------------------------------------------------
<table>
<tbody>
<tr>
<td valign="middle" width="120"><a href="http://www.sun.com"> <img
src="cid:part1.01050407.02010805@sun.com" border="0"></a> </td>
<td class="bg"
background="file:///F:/doc/mail/Signature/images/SunJava.gif"
nowrap="nowrap" valign="middle"> <b>J Jaison Daniel, M.S.,</b><br>
Member Technical Staff<br>
<br>
</td>
</tr>
</tbody>

</table>
-----------------------------------------------------------------------------------------------
see the img tag was embedded into the mail but the background ?
User avatar
Rod Whiteley
Posts: 11480
Joined: December 6th, 2004, 3:41 am
Location: UK

Post by Rod Whiteley »

Thunderbird does not support any embedded content.

Thunderbird supports the IMG tag by sending the image as an attachment.

Thunderbird does not support sending background images in tables. This has been reported, but developers do not seem to be working on it. If a future release does support background images in tables it will probably only support CSS, not the background attribute.

It is strange that Thunderbird displays the background image. I do not know why it does that.

None of this is new in Thunderbird 2. It has always been this way.
Rod
User avatar
jaison.daniel
Posts: 2
Joined: August 22nd, 2007, 6:52 am
Contact:

Post by jaison.daniel »

Fine!, embedding image have some limitations in thunderbird & I tried another way, still facing another issue with style. Some style have the value as a url, But thunderbird treat as a link and it spoils the purpose of the style. ex.
<style type="text/css">
.bg {
background-image: "http://www.geocities.com/jaison.daniel/img/phone2.gif";
background-repeat: no-repeat;
background-position: center center;
}
</style>
The above style will be changed by the thunder bird as
<style type="text/css">
.bg {
background-image: <a class="moz-txt-link-rfc2396E" href="http://www.geocities.com/jaison.daniel/img/phone2.gif">"http://www.geocities.com/jaison.daniel/img/phone2.gif"</a>;
background-repeat: no-repeat;
background-position: center center;
}
</style>
--
J Jaison Daniel, M.S.,
User avatar
JoeS
Posts: 2337
Joined: June 8th, 2003, 9:15 am

Post by JoeS »

I think you will have little luck here.
The basic problem is in core code. Some of which has been rotting forever.
It's a very real problem to try to use advanced functions like this when the core backbone for mail is circa 2001
See this bug for one:
# 154836 [Core] - Image sent embedded is not used for the style sheet. CID: url types doesn't work for CSS [All]
JoeS Testing current Thunderbird trunk builds WinXP SP2+
news://news.mozilla.org.mozilla.test.multimedia How to Post
apollo51
Posts: 1
Joined: May 1st, 2009, 6:56 pm

Re: background image is not send as embedded

Post by apollo51 »

As explained here, there seems to be a bug with the Thunderbird email composer that causes it to kill any images put in using CSS styles. Actually, it does more than this, but this is the one effect I am concerned with, currently. I was attempting to do what the original poster was doing - I wanted a nice background image, inserted by css, for my emails. (Note you can put a background image over the whole email using "body background", and that works already; however if you apply it with css you can do more. Applying it with css currently does not work, AFAIK. If you fix it as explained below, it will work, however you will also be sending "remote images" with your email - not a bad thing, but good to know in advance.)

Basically thunderbird scans through emails before sending them, looking for addresses - such as http://airborn.com.au - and it turns them into links. To do this is wraps them in an html a :
<a href="http://airborn.com.au"> http://airborn.com.au </a>

The trouble is it does the same to your css
background-image: url(airborn.com.au/image1/sky1.gif) ;
gets munged by thunderbird putting "<a href... " after "url(" which causes the css image to be inoperative when the email is received.

However, if you wrap your css in html comments, then thunderbird leaves it alone. The css should still be executed by the receiving email program - wrapping the style sheet in html comments was a standard way of telling older browsers (without styles) to ignore the text that made up the style rules - by extension newer browsers can be expected to still parse css between the comments.

My code, to apply a background image to any table with "class=backgroundTable" now worked. With the <!-- and //--> comment tags, it is:

<style type="text/css">
<!--
.backgroundTable { background-image: url(http://airborn.com.au/image1/sky1.gif); }
//-->
</style>

So in summary, if you are having problems with css images not working when emailing from thunderbird, alter your css to wrap your style rules in <!-- and //--> comment tags.
User avatar
Diorser
Posts: 1009
Joined: June 22nd, 2005, 6:57 am

Re: background image is not send as embedded

Post by Diorser »

This does not seem to work with TB V7.0.

If a template is saved with a css background image, the background image will not show up while creating a mail from this template.
User avatar
LIMPET235
Moderator
Posts: 39956
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: background image is not send as embedded

Post by LIMPET235 »

This thread is from 2009.
Please start a new one, stating your problem.
Thank you.
Locking this oldie.
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
Locked