• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1192
  • Last Modified:

Line break in ALT of HTML image link

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
NCHCIT
Asked:
NCHCIT
  • 11
  • 5
  • 4
  • +1
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
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
 
NCHCITAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
JerseyFooCommented:
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
 
NCHCITAuthor Commented:
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
 
JerseyFooCommented:
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
 
JerseyFooCommented:
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
 
DubouxCommented:
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
 
NCHCITAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
Did you put back slashes instead of forward slashes on purpose?  Back slashes don't work on the web.
0
 
NCHCITAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
DubouxCommented:
you're supposed to upload the file there.
not copy/paste the file name

It changes binary code into base64
0
 
DubouxCommented:
Try this one, this looks way easier to use:

http://www.dailycoding.com/Utils/Converter/ImageToBase64.aspx
0
 
NCHCITAuthor Commented:
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
 
NCHCITAuthor Commented:
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
 
NCHCITAuthor Commented:
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
 
DubouxCommented:
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
 
NCHCITAuthor Commented:
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
 
NCHCITAuthor Commented:
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
 
NCHCITAuthor Commented:
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
 
NCHCITAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 11
  • 5
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now