Question

Rendering background images in Outlook 2007 HTML

Asked by: richdan

I need to send an HTML email to my existing clients that uses a table structure with some cells containing background images with overlaid text.

These images will not render correctly in Outlook 2007. Can anyone suggest a workaround or solution to this problem?

Regards

Danny

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-04-16 at 07:56:21ID22513712
Tags

outlook

,

background

,

2007

,

image

,

html

Topics

Hypertext Markup Language (HTML)

,

Web Languages/Standards

,

Outlook Groupware Software

Participating Experts
6
Points
500
Comments
34

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. JTable: Rendering Single Cells
    I'm creating a JTable. Each row's data can be of a distinct type (text, integer, boolean, multiple choice, etc). Thus I need to set the cell renderer for each cell. On the web I only found how to set the renderer for a column. How can I set the renderer for a cell? Thanks
  2. Outlook Web Access not rendering properly for hosts.
    We are having a problem at a customers site with Outlook Web access. It works when I load the webpage locally on the server, page renders fine, but when we come from any other host, internal or external, it renders all funky. (see examples below) I didn't see anything out o...
  3. Outlook 2003 renders &nbsp as text
    I have an event procedure in Access 2003 that outputs an email with a HTML body using html code. It is a shared database being used on three machines. Two of the machines render the email perfectly. The third machine renders the "& n b s p" as text (the space...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: fuzzboxerPosted on 2007-04-16 at 08:04:57ID: 18918152

Outlook 2007 uses the HTML rendering engine from Word 2007 which means it barely has any support for CSS.  My suggestion is to build your email in Word 2007 and use that code.

 

by: richdanPosted on 2007-04-16 at 08:37:13ID: 18918447

Thanks  fuzzboxer

This is not a css issue. There is no css in the source code. This is a simple background image for a table cell that will not render. Using Word 2007 to create the code is not a viable option

Thanks anyway
Regards

Danny

 

by: kevp75Posted on 2007-04-16 at 12:34:08ID: 18920146

use the full URL for the images...

if the background image is ="/images/image.jpg", then make it ="http://www.yourdomain.com/images/image.jpg"

 

by: rdivilbissPosted on 2007-04-16 at 15:46:29ID: 18921243

The added benefit to kevp75's suggestion of using the full url to the image is that your web server logs will track who rendered your e-mails.

The alternative is quite painful, and requires building a multi-part mime message with the images stored as base64 encoded message parts.

 

by: richdanPosted on 2007-04-16 at 15:59:59ID: 18921297

Thanks for your suggestions

The full url of the images is already being used. The reason that the images are not displaying is due to the fact that the rendering engine in Outlook 2007 will not recognise background images as a valid tag even with the full URL.

There is an article with more information here:
http://www.campaignmonitor.com/blog/archives/2007/01/microsoft_takes_email_design_b.html

I am trying to find out if there is any known solution or workaround to this probllem

Regards

Danny

 

by: kevp75Posted on 2007-04-16 at 16:49:16ID: 18921444

well...apparently you are SOL.

What about trying out the CSS method?  (dont' come back here and say it won't work, unless you actually try it out first please...)

 

by: rdivilbissPosted on 2007-04-16 at 18:54:27ID: 18921879

I didn't work for me using CSS to set a background image via full URL.

 

by: kevp75Posted on 2007-04-16 at 19:05:32ID: 18921931

now, what about using some CSS to absolutely position the image, give it a z-index, and position the text over it with a higher z-index?

 

by: rdivilbissPosted on 2007-04-16 at 19:13:47ID: 18921959

I got it to work.

I wrapped the body text in a DIV and gave the DIV tag an inline style.

Here's the PHP code.

<?PHP
error_reporting(E_ALL | 2048);

function sendMail($to, $subject, $body="", $title="", $from="", $cc="", $bcc="", $reply="") {
      $mailer = new COM("Persits.MailSender")  or die("Unable to instantiate aspemail");
      $smtp = "mail.domain.com";
      $login = "admin@domain.com";
      $pwd = "xy7324klhew";      
      
      $body = "<DIV STYLE=\"background-image: url('link removed'); background-repeat: repeat; background-position: left top;\"><FONT face=Arial size=2>Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Cras dolor. Sed sed neque. Duis eros justo, bibendum in, placerat eget,
ullamcorper vel, nibh. Praesent urna arcu, sagittis eget, semper laoreet, tempus
non, augue. In a pede. Vestibulum consequat eleifend sem. Duis tristique tortor
ultricies massa. Duis sapien eros, posuere sit amet, rhoncus non, venenatis
bibendum, tellus. Donec dui tortor, dignissim quis, eleifend eget, fermentum a,
massa. Maecenas vel enim vitae sapien condimentum eleifend. Duis hendrerit
luctus dui. Donec sem dui, posuere a, consectetuer eget, pretium aliquet,
turpis. Vestibulum posuere porta lacus. Sed convallis molestie purus. In hac
habitasse platea dictumst.</FONT></DIV>
<DIV>&nbsp;</DIV>";
      $mailer->Host = $smtp;
      $mailer->Username = $login;
      $mailer->Password = $pwd;
      $mailer->AddAddress($to);
      if ($from=="") {
            $mailer->From = "webmaster@domain.com";
            $mailer->FromName = "My Company";
      }else{
            $mailer->From = $from;
      }
      if ($cc!="") {
            $mailer->AddCC($cc);
      }
      $mailer->Subject = $subject;

      $mailHead = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
      $mailHead .= "<html>\n<head>\n  <META http-equiv=Content-Type content=\"text/html; charset=utf-8\">\n";
      if ($title!="") {
            $mailHead .= "  <title>$title</title>";
      }
      $mailHead .= "  </head>\n";
      
      $mailBody = "<body>\n  <div>\n";
      $mailBody .= "    $body\n";
      $mailBody .= "  </div>\n</body>\n</html>";

      $mailer->Body = $mailBody;
      $mailer->IsHTML = true;
      
      $mailer->Send() or die("failed");
      unset($mailer);

}

// usage
echo sendMail("person@domain.com","E-Mail Background Test");
?>


Regards,
Rod

 

by: rdivilbissPosted on 2007-04-16 at 19:19:23ID: 18921977

 

by: kevp75Posted on 2007-04-16 at 19:38:50ID: 18922038

now I'm confused....

If the CSS method does not work, how then does the inline style work?  inline styling is nothing more than inline CSS:

Your Comment      
kevp75:
well...apparently you are SOL.

What about trying out the CSS method?  (dont' come back here and say it won't work, unless you actually try it out first please...)
             
      Author:rdivilbissDate:04.16.2007 at 09:54PM EDTExpert Comment      

Rank: Master
rdivilbiss:
I didn't work for me using CSS to set a background image via full URL.

 

by: fuzzboxerPosted on 2007-04-16 at 19:54:51ID: 18922086

Loophole in the code, I would assume.  Word 2007 supports the <div> tag and style element and it looks like a workaround.

 

by: rdivilbissPosted on 2007-04-16 at 20:24:12ID: 18922152

>>now I'm confused....

>>If the CSS method does not work, how then does the inline style work?  inline styling is nothing more than inline CSS:


Maybe the body tag can take an inline style.  I didn't try that.  I simply tried inline style on a division.

>>What about trying out the CSS method?  (dont' come back here and say it won't work, unless you actually try it out first please...)

The asker did not post results, I made an example and tried it in an effort to anser the question.
             
>I didn't work for me using CSS to set a background image via full URL.

That was using embedded CSS for the body... not inline style.

Rod

 

by: kevp75Posted on 2007-04-16 at 20:37:26ID: 18922179

understandable...still confuses the he77 outta me tho.....technically, if embedded CSS (or even linked) does not work, then neither should the inline style...

 

by: rdivilbissPosted on 2007-04-16 at 20:41:21ID: 18922189

Hey, I just got it to work that way and could be happy with that as a solution...I don't know why it worked. on the DIV and not the BODY.

 

by: richdanPosted on 2007-04-17 at 01:13:58ID: 18922812

Hi Rod
Many thanks for this suggestion. Unfortunately it does not work for me :(

I have used this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<table width="300" height="656" align="center" cellpadding="5">
  <tr>
<td height="650">

 <div STYLE="background-image: url('http://www.richmansoftware.com/images/girllaptop.jpg'); background-repeat: repeat; background-position: left top;">
       
      This is my text and it appears in front of the background image.
  </div>

      
      </td>

  </tr>
 </table>
</body>
</html>

The email displays without the background image in Outlook 2007
Any idea why it is work for you but not for me?

Regards

Danny

 

by: rdivilbissPosted on 2007-04-17 at 07:37:14ID: 18924543



Note the image was cropped because my body text wasn't long enough to expand the division.  Other than that, your image seems to work.

Just make sure you have enough text to make the division expand to reveal the whole image.

 

by: richdanPosted on 2007-04-17 at 07:47:05ID: 18924624

Thanks Rod

Are you sure you are viewing this in Outlook 2007?

I have tried this on 3 seperate PCs with Outlook 07 installed and all will not display the background image

The Outlook settings on all PCs are set to display images in messages
Danny

 

by: rdivilbissPosted on 2007-04-17 at 08:05:20ID: 18924768

I'm terribly sorry...Outlook 2003 here.

 

by: cbittnerPosted on 2007-04-18 at 09:01:24ID: 18932746

The only place I have had success with a background image is if it is in the body tag.

 

by: rdivilbissPosted on 2007-04-18 at 10:41:26ID: 18933533

I'm wondering if this is some sort of anti-spam setting in Outlook 2007.

In Outlook 2003 I had to manually tell it not to download images.  In Outlook 2007 that may be enabled by default.

Frankly (not helpful to your question) I stopped receiving HTML email years ago, and still haven't changed that because of all the new zero day attacks over the last few years which primarily involved e-mail attachment vectors including images.

Sorry again about the 2003 -2007 confusion.

 

by: richdanPosted on 2007-04-18 at 10:48:06ID: 18933587

Images are disabled by default in 2007, but even if you allow them it will still not display background images.

No probs re confusion

Regards

Danny

 

by: rdivilbissPosted on 2007-04-18 at 11:10:53ID: 18933759

It's not surprising. MS has been really locking down their products, which is one way to deal with some of the vulnerabilities, but fixing the vulnerabilities rather than crippling the products is probably better.

 

by: fuzzboxerPosted on 2007-04-18 at 11:21:22ID: 18933853

I loaded the following code into Word 2007 and it displays the background image:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body style="background-image:url(images/image.jpg); height:150px;">
<div>
<h1>Headingr</h1>
</div>
</body>
</html>

I tried it with the div and it didn't work.  

 

by: rdivilbissPosted on 2007-04-18 at 11:24:44ID: 18933875

Word 2007 but what about Outlook 2007

 

by: fuzzboxerPosted on 2007-04-18 at 11:30:59ID: 18933936

Outlook 2007 uses Word 2007 as its rendering engine, so it displays like Outlook would.

 

by: fuzzboxerPosted on 2007-04-18 at 11:32:37ID: 18933945

I just tested in Outlook 2007 and it works.

 

by: rdivilbissPosted on 2007-06-28 at 13:05:53ID: 19384231

mplungjan,

"Outlook 2007 will not recognise background images as a valid tag even with the full URL."

I don't think any of us solved this problem.  Microsoft changed the rendering engine in Outlook 2007, and as far as I know, there is no solution unless MS decides to update/patch Outlook 2007.

Rod

 

by: cbittnerPosted on 2007-06-28 at 13:39:07ID: 19384600

Wow, I forgot I had this out there. Here is a great site that highlights what you can and cannot do with Outlook 2007.
http://www.campaignmonitor.com/blog/archives/2007/04/a_guide_to_css_support_in_emai_2.html#pc

 

by: jonathannielsPosted on 2009-01-08 at 01:54:41ID: 23323402

Hi,

Being a professional emailtemplate programmer I don't use backgroundimages anymore since the introduction of MS Outlook 2007.

Backgroundimages simply do not get displayed in Outlook 2007.

Regards,

Jon

 

by: parsonssPosted on 2009-04-09 at 08:54:33ID: 24108467

It depends on how desperate you are to achieve this. One possible work around that I have investigated is not to us background images, but in fact normal images which - wait for it (cringe) - retrieve a dynamic image generated by asp.net http handlers.

In my situation i wanted to welcome a person by name, and tell them how long they had to go to a certain date in the future (+ some other welcome text etc). This information was dynamically addeded using GDI+ on the server.

I leaves a bad taste in your mouth, but it works and the email looks the way you want it to look - and in the end of the day the only bit thats slightly out of the ordinary is the use of GDI+ to effectively draw the text onto the image that you would have otherwise used as the background, everything else, including retrieving the image of the hard drive (which your server would have done anyway) is the same.

There is also one up side to this too. Because the text is effectively an image, you can anti-alias it.

Si

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...