Image style height and width not taken in outlook mails

后端 未结 9 2096
情书的邮戳
情书的邮戳 2020-12-08 01:34

I have a following dom structure in html content I am sending as email.



        
9条回答
  •  温柔的废话
    2020-12-08 02:33

    I had the pleasure of creating an email for outlook 2010 based on sharepoint data. But when creating an outlook email, outlook in its wisdom reduces the image width and height to cm. Interestingly using the width and height kicks in correctly when you forward the email but not when you open it.

    Hack Fix:

    I had an image [720px X 150px] which should be [19.05cm X 3.98cm]. BUT outlook set the image width and height to [15.24cm X 3.18cm]. Clearly this is a problem.

    The hack I used was setting the html image tag as follows:

    
    

    Why that width and height?

    Well it is the ratio (25% increase) between

    • what outlook was saying and
    • what it should be by adding 25% of the current size; which is (720 X 1.25 = 900) and (150 X 1.25 = 187.5).

    Its not pretty but it works.

提交回复
热议问题