Reliable solution for conditional comments in Outlook.com HTML emails

前端 未结 4 1353
春和景丽
春和景丽 2021-01-03 10:38

I\'ve seen here and elsewhere that a recommended way to set up conditional comments to work with Outlook.com, but because of another known issue detailed below I\'m getting

4条回答
  •  天涯浪人
    2021-01-03 11:40

    I don't know if using CSS to hide/show is the best route to go since not all email clients will process/honor that css (I tested a version in the Outlook windows client and it didn't work). I think the reason Outlook.com is consuming the conditional branching is because the syntax people are using is slightly off. When I corrected my syntax, the code rendered correctly in both Outlook.com and Outlook the windows client. I also tried the iphone Outlook app, the iphone built in email app, and icloud (web) and the code renders correctly.

    One thing to note is that if you are using razor script on IIS, be sure to wrap the if !mso in elements so IIS knows not to process it as razor script. Here is my code snippet:

    
    code to render in Outlook.com
    

提交回复
热议问题