Embedding GIF into HTML?
How do i embed pictures into HTML? I have a cron job that sends an HTML file and I'm using
Code:
<img src="http://mysite/picture.gif"> The problem is that when the user recives the email, Thunderbird or outlook will ask whether to download the the picture from the site or not. The picture contains my companies logo and i would like it to show up the moment the user opens the email. I've seen it done before I've seen some articles about embedding GIF using base64 encoding but i have no clue how to do that... Anyone can help? |
that's really none of your business, it's the client taking measures to protect the user irrespective of the file. you shouldn't be able to influence that at all, or that would totally destroy the security measures in the first place.
|
((especially important with GIFs since they are a way of embedding malicious code))
Much better to use words and include a link to a website. |
|
attach the image (base64 encoded) with
Content-ID: <image01.png@FFFFFFFF.FFFFFFFF> in the html part, reference as source of the image the Content-ID like so: "cid:image01.png@01C8584B.D9F65490" that will then point to the attachment rather than an external image i would personally use a png rather than a gif! @moderators: remove this if you find it inappropriate, as i am sure you would anyway :-) |
but surely any client would block that in exactly the same way..? if it's malicious it's just as malicious there, no?
|
it does not look like the clients block the displaying of attached images, but of course it's slightly ugly, as it increases the email size, and also all your emails have an attachment.
i also am not sure what happnes if you simply have a div and add a background image with css to that, would be worth a try. |
I got half of the problem resolved. I was able to convert my companies logo using uuencode then embed it into HTML using base64 encoding. Part of my code looks like this:
Code:
<img src="data:image/gif;base64,R0lGODlh0wFvAOf+AAABBg0PDBIUERYYFhobGR4gHQQc .. > Thanks in advance. |
All times are GMT -5. The time now is 01:46 PM. |