I made an HTML Email Template that is working fine in most email readers, but the background images are not showing in Outlook 2007, 2010, and 2013. How can I solve the prob
Outlook 2007 and later only supports 2 ways to display a bg image:
In both cases, Outlook scales the image differently than other email readers, and there's no way to prevent the bg image from tiling.
So for all practical purposes, background images aren't an option for supporting a wide range of email readers. Instead, you'll need to make do with foreground images (img
tags).
Outlook 2007+, Gmail, Hotmail, and Yahoo Mail don't support CSS positioning. As a result, there's no way to place a text element on top of a foreground image.
When slicing up the email into different areas (typically using HTML tables), each area can either be a text element or a foreground image. But you can't have both in the same area (i.e., you can't have two elements occupying the same space or overlapping).
For areas where there's an image with no text on top of it, that part of the email can be cut as a separate foreground image.
For areas where there's an image with text on top of it, there are 3 options:
In moderation, option #1 is usually safe and reasonable. But when used heavily, it leads to a very high ratio of images to text in the email, which may trigger some spam filters. Before making heavy use of option #1, test the email in a variety of spam filters.
Before proceeding with options #2 or #3, you may need to clear it with the designers (as either one compromises the design in Outlook 2007+). In the bigger picture, background images should be used sparingly when designing emails. It may be helpful to point out to the designers the impact of using background images.
We can add this way :-
Add the following right after the opening tag…
<table cellpadding="0" cellspacing="0" border="0" height="92" width="100%">
<tr>
<td background="https://i.imgur.com/YJOX1PC.png" bgcolor="#7bceeb" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:92px;">
<v:fill type="tile" src="https://i.imgur.com/YJOX1PC.png" color="#7bceeb" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
…and this right before the closing tag.
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
background-image
is not supported in Outlook or Gmail on Android 2.3. See: http://www.campaignmonitor.com/css/
I usually use background-color
as a fallback, or if the background image is necessary, make the text part of the image.
Outlook only supports background images in the body tag unless you use VML. Check this out for VML: http://backgrounds.cm/
Here is an example of it working in the body tag.
I think you'll find this really handy: http://www.campaignmonitor.com/css/
Outlook 2007-13 doesn't support the background-image property, so there is not any good way to solve for this.
Based on personal experience: To get the most consistent experience across email clients, I would redesign the email to not require a background image.
October 2018 - Tested in Outlook 2016
Figured I'd chime in with the VML snippet that worked for me. Taken from https://medium.com/@ka.robinson82/https-medium-com-ka-robinson82-fargo-email-6907f00fed16
<! — [if gte mso 9]>
<v:image xmlns:v=”urn:schemas-microsoft-com:vml” style=”width:525pt; height:348.75pt;” src=”image.jpg" />
<v:rect xmlns:v=”urn:schemas-microsoft-com:vml” fill=”false” stroke=”false” style=”position: relative; width:525pt; height: 161.25pt; top: 187.5pt;”>
<v:textbox inset=”0,0,0,0">
<![endif]
<!-- Content -->
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
Other VML snippets worked to an extent but I had issues with the image disappearing after leaving the email and coming back, or not loading until the background was clicked on.