Solved

Line break in ALT of HTML image link

Posted on 2011-03-14
23
1,174 Views
Last Modified: 2012-05-11
Everything I read indicates that there really isn't a way to achieve what my firm wants, but I'm hoping I'm missing something.  Our client development committee created a graphic signature for our emails and asked me to propagate and deploy it.  Because we're still on Exchange 2003 and are always running close to our 75 GB information store limit, having hit it and crashed on more than one occasion, I created the signature using a link to the image on our web host and set GPO to force senders to send the link rather than a copy of the graphic.

Users would really like to send the graphic itself so it always shows, so I had to use the ALT text of the image to say what the graphic says, so that even if the receiving mail handler reads in plain text or doesn't automatically download images, the recipient would still see the content of the signature.  However, there are several lines to that signature, and the returns only show in IE.  When recipients use a web client through Firefox, the alt text just reads as one run on line.

I've played around with creating a text version, too, based on the idea that the MIME handling of Outlook would attach both and present whichever the receiving mail handler preferred.  It still just displayed the alt text of the image.  I tried modifying some PHP script, but that didn't work out in my test run.  The DHTML pop-ups don't seem to be a good solution either since that means the recipient still needs to be reading HTML.

Is there any solution that will give my firm what it wants, that will show the text of the signature with returns if the image isn't downloaded?
0
Comment
Question by:NCHCIT
  • 11
  • 5
  • 4
  • +1
23 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 35131606
Two things: DHTML with javascript won't run in most email clients.  And most email clients these days block remote images until the reader Ok's them.  That's to preserve the privacy and security of the client.
0
 

Author Comment

by:NCHCIT
ID: 35131627
Yeah, those are the problems I'm facing with giving my firm what it wants in light of our storage limitations.  The ALT text would cover our needs, if only it consistently allowed breaks in all mail handlers and web browsers.  Is there a work around?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 35131716
Not unless you count HTML formatted text (instead of images) which I get from some people.  HTML email is a mess.  This http://www.campaignmonitor.com/css/ is the first page you should look at.  Though you're not talking about newsletters, this http://articles.sitepoint.com/article/code-html-email-newsletters can tell you a lot about the problems.
0
 
LVL 1

Assisted Solution

by:JerseyFoo
JerseyFoo earned 250 total points
ID: 35131877
You can listen to the nub above if you like, but now for something relevent...

Image tags are just shortcuts for object tags.  A object renders the html inside of it if the request fails.  Code attached; tested on Firefox and Chrome.
<object type="image/jpeg" data="no-exist.jpg">
    Line 1<br/>
    Line 2<br/>
    Line 3
</object>

Open in new window

0
 

Author Comment

by:NCHCIT
ID: 35132111
JerseyFoo -

This is an example of what I have now:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Andrew J. Reid</title>
<meta name="generator" content="Virtual Mechanics SiteSpinner Pro V2 291h - Trial Only">
<meta http-equiv="imagetoolbar" content="false">

<style type="text/css">
<!--
body {
  margin: 0;
  height: 100%;
  width: 100%;
  background-color: #ffffff;
}
img {
  border-width: 0;
  vertical-align: top;
}
#Oobj1 {
  position: absolute;
  font-size: 10px;
  z-index: 1;
  left: 0.00em;
  top: 0.20em;
  width: 41.30em;
  height: 26.40em;
}
img#Ggeo1 {
  width: 100%;
  height: 100%;
}

-->
</style>
</head> 

<body>

<div id="Oobj1">
<img id="Ggeo1" src="http://www.nchc.com/E_Letterhead/AReid.jpg" alt="Andrew J. Reid
Attorney

areid@nchc.com
www.nchc.com
T: 805-485-1000
D: 805-988-8314
F: 805-988-7714

Nordman Cormany Hair & Compton LLP
1000 Town Center Drive
Oxnard, CA  93036"></div>


</body> 
</html> 

Open in new window


What do I replace or where do I add your code?

Thanks!
0
 
LVL 1

Expert Comment

by:JerseyFoo
ID: 35132415
Instead of the <img tag, you would use this...
<object id="Ggeo1" type="image/jpeg" data="http://www.nchc.com/E_Letterhead/AReid.jpg">
Andrew J. Reid
<br/>Attorney
<br/>
<br/>areid@nchc.com
<br/>www.nchc.com
<br/>T: 805-485-1000
<br/>D: 805-988-8314
<br/>F: 805-988-7714
<br/>
<br/>Nordman Cormany Hair & Compton LLP
<br/>1000 Town Center Drive
<br/>Oxnard, CA  93036
</object>

Open in new window

0
 
LVL 1

Expert Comment

by:JerseyFoo
ID: 35133410
I'd just like to add as a note here;  This should work, although I haven't tested it for mail.

If the mail client actually blocks the images, it will work.  If the mail client alters the HTML improperly -- it may not.  I am not familiar with how mail clients choose to block images however it would not surprise me if they chose some makeshift method such as chopping up the HTML.

The HTML I gave you behaves in the browser as a image with a glorified alt tag.
<img src="image.jpg" alt="woops" />

<!-- Actually compiles into -->
<object type="image/jpeg" data="image.jpg">woops</object>

<!-- However the compiler treats the alt parameter as an attribute, and parses out HTML -->

Open in new window

0
 
LVL 3

Accepted Solution

by:
Duboux earned 250 total points
ID: 35136700
wow, JerseyFoo, I learned something new =)

@NCHCIT: I dunno if it works in email or not, but how about u convert images to base64 code and send it with in your html.

basically what changes, is that u send a large amount of unreadable text that will show in the client as an image.

like:
<img alt="Embedded Image" 
  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />

Open in new window

or
div.image {
  width:100px;
  height:100px;
  background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...);
}

Open in new window

0
 

Author Comment

by:NCHCIT
ID: 35142011
JerseyFoo:  Any ideas on why it's trying to put DavWWWRoot in the URL?  It ends up not pulling in the graphic at all.
Sig Seeking Graphic as Object
Duboux:  What would I use to convert the image to base64 code?  Does that trigger spam blockers?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 35142664
Did you put back slashes instead of forward slashes on purpose?  Back slashes don't work on the web.
0
 
LVL 3

Expert Comment

by:Duboux
ID: 35142853
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:NCHCIT
ID: 35159442
DaveBaldwin:  That's the odd thing.  This particular signature file reads
data="http://www.nchc.com/E_Letterhead/HLore.jpg"

Open in new window


but what you see in the image is what it's trying to do, including adding the DavWWWRoot in the path.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 35159477
Look here: http://www.mriwm.com/Public/PamBlog/Lists/Posts/Post.aspx?ID=10
There is a link to fix at the bottom.  See if it works for you.
0
 
LVL 3

Expert Comment

by:Duboux
ID: 35159541
you're supposed to upload the file there.
not copy/paste the file name

It changes binary code into base64
0
 
LVL 3

Expert Comment

by:Duboux
ID: 35159557
Try this one, this looks way easier to use:

http://www.dailycoding.com/Utils/Converter/ImageToBase64.aspx
0
 

Author Comment

by:NCHCIT
ID: 35160222
Duboux:
Since the graphic we send is in jpg format, do I still put  src="data:image/png; or do I put something like  src="data:image/jpg; or  src="data:image/jpeg;?  I tried the middle option but don't get anything coming through - no image and no text.
0
 

Author Comment

by:NCHCIT
ID: 35160325
Duboux:  Drat - it seems like such a good idea, but even though I can see the image by opening the file from a web browser, it doesn't translate it when sent from Outlook - even when picked up through the internet from a web mail account.
0
 

Author Comment

by:NCHCIT
ID: 35160438
JerseyFoo:  
I can send successfully using your technique from a Windows XP/Outlook 2003 system (I am testing Windows 7/Outlook 2010 for the firm, from which it does not work).  However, it shows up on the other end as just the text without the option to download the image.  Any ideas?
0
 
LVL 3

Expert Comment

by:Duboux
ID: 35164104
That's sad to hear.
Just for our future childrens part

you exactly typed this, right ?

<img alt="Embedded Image"
  src="data:image/jpg;base64,==========" />
with the ===='s being replaced for that load of spam.
And you kept the , in there

And that didn't work in email, correct ?
0
 

Author Comment

by:NCHCIT
ID: 35166798
Duboux:
I've got

<img id="Ggeo1" src="data:image/png;base64,/9j/4AA============" alt="Sender Name">

I'll try it exactly as you've written it above -replacing the sender name with Embedded Image, putting the alt attribute first, omitting the id and adding the slash - and get back to you.

Thanks.
0
 

Author Comment

by:NCHCIT
ID: 35166946
Duboux:
Unfortunately, while I am seeing the outline of the image, I only get a red X and the alt text.

 Base64 Signature result
0
 

Author Comment

by:NCHCIT
ID: 35167684
JerseyFoo:

Such a great idea, but it seems <object> is seen as an activex control, and so is blocked by Outlook security.  :(  I changed Outlook to use internet security rather than restricted sites, and set it to allow ActiveX controls, but still no luck.  I wouldn't want to open us to a security risk by doing that outside of a test environment regardless.
0
 

Author Closing Comment

by:NCHCIT
ID: 35192734
Great solutions. While they don't resolve my current issue, they give me some very helpful direction to get there, or to know if it's just not possible.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now