0

I am trying to embed an svg image in my mail. Mail is written in HTML. Here is the sample HTML page I use for testing:

<html>
    <head>
        
    </head>
    <body>
        <svg height="29px" version="1.1" viewbox="0 0 60 29" width="60px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
            <g fill="#F11485" fill-rule="evenodd">
                <path d="M23.190739,0 L0.254843285,0 L0,10.2466667 L1.52905971,10.5044444 C1.783903,7.47555556 2.61214367,5.22 3.8863601,3.80222222 C5.22428735,2.25555556 7.07190117,1.48222222 9.49291238,1.41777778 L9.49291238,22.8133333 C9.49291238,24.6822222 9.23806909,25.9066667 8.6646717,26.4866667 C8.21869595,26.9377778 7.45416609,27.26 6.30737131,27.3888889 C5.9888172,27.3888889 5.41541981,27.4533333 4.65088996,27.4533333 L4.65088996,29 L18.7946923,29 L18.7946923,27.3888889 C18.0301624,27.3888889 17.456765,27.3888889 17.1382109,27.3244444 C16.055127,27.1955556 15.2905971,26.9377778 14.7809105,26.4222222 C14.271224,25.8422222 13.9526699,24.6177778 13.9526699,22.7488889 L13.9526699,1.41777778 C16.3099703,1.48222222 18.2212949,2.25555556 19.5592221,3.80222222 C20.8334386,5.28444444 21.5979684,7.47555556 21.9165225,10.5044444 L23.4455822,10.2466667 L23.190739,0 L23.190739,0 Z"></path>
            </g>
        </svg>
    </body>
</html>

This page when saved as .HTML file and loaded into Chrome displays image without problem, so it works.

But, it does not show if I send it through mail. I use Java to send the mail. I set content type to be HTML, and in my mail I get the HTML elements I defined in my template, so this confirms that the mail is sent successfully and that mail is picked up as HTML.

However, while other elements on the page are displayed in the mail, svg is not.

I use hotmail server to send the e-mail from Java to an e-mail account on Office 365 (Outlook). So @hotmail.com is the sender domain.

So, why is this picture not displayed in the Outlook? How to make it display?

(I saw several similar questions on StackOverflow, but they do not apply to my case since they are having trouble with images located at the specific link, but my problem deals with the image embedded into the HTML.)

1 Answers1

1

Visibility of images strongly depends e-mail client. Tehere is a lot of possibilites images will be not visible eg.:

  1. safety settings;
  2. supporting image formats ( svg i relatively new format ).

More here: How can I embed SVG into HTML in an email, so that it's visible in most/all email browsers?

katakrowa
  • 162
  • 6