VML Background Generator

Generate the VML code required for background images in Outlook on Windows. Without VML, background images are ignored in Outlook 2007–2021.

Background Settings

Must be an absolute, publicly accessible URL.

VML works only in Outlook on Windows

The generated code uses both VML (for Outlook) and a CSS background-image fallback (for all other clients). Both are required for cross-client support.

Approximate preview (non-Outlook)

Your email content goes here

This preview shows the CSS fallback — Outlook renders via VML code below.

Generated VML + HTML
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml"
        fill="true"
        stroke="false"
        style="width:600px;height:300px;">
  <v:fill type="frame"
          src="https://example.com/background.jpg"
          color="#1a1a2e" />
  <v:textbox inset="0,0,0,0">
<![endif]-->

<!--[if !mso]><!-->
<table role="presentation" cellpadding="0" cellspacing="0" border="0" width="600"
       style="background-image:url('https://example.com/background.jpg');
              background-color:#1a1a2e;
              background-size:cover;
              background-position:center;">
  <tr>
    <td style="padding:40px;">
<!--<![endif]-->

      <!-- ============================================ -->
      <!-- YOUR CONTENT HERE — works in all clients    -->
      <table role="presentation" cellpadding="0" cellspacing="0" border="0" width="520" align="center">
        <tr>
          <td align="center" style="color:#ffffff;font-family:Arial,Helvetica,sans-serif;font-size:16px;padding:20px 0;">
            Your email content goes here
          </td>
        </tr>
      </table>
      <!-- ============================================ -->

<!--[if !mso]><!-->
    </td>
  </tr>
</table>
<!--<![endif]-->

<!--[if gte mso 9]>
  </v:textbox>
</v:rect>
<![endif]-->

How to use VML backgrounds

1. Set your dimensions

Set width and height to match the table cell or section where the background will appear. Fixed pixel dimensions are required for VML.

2. Add your content

Replace the placeholder div with your actual email content. Text, buttons, and images all work inside the VML textbox.

3. Test in Outlook

Always test in an actual Outlook installation. The VML must be correctly formed — invalid VML silently fails and falls back to no background.