in html templates for email can I use mso | IE - html

I have a code with if condition:
<!--[if mso | IE]> ... <![endif]-->
I don't know the answer if I can use | as the divider for mso and internet explorer or if I should do two "if's"

Yes you can use | in the conditional statements.
Outlook Version MSO Comment Code
Codes to target specific email clients:
Outlook Version
MSO Comment Code
All versions of Outlook
<!–[if mso]> code <![endif]–>
Outlook 2000
<!–[if mso 9]> code <![endif]–>
Outlook 2002
<!–[if mso 10]> code <![endif]–>
Outlook 2003
<!–[if mso 11]> code <![endif]–>
Outlook 2007
<!–[if mso 12]> code <![endif]–>
Outlook 2010
<!–[if mso 14]> code <![endif]–>
Outlook 2013
<!–[if mso 15]> code <![endif]–>
Outlook 2016 and 2019
<!–[if mso 16]> code <![endif]–>
Code Definition
MSO Comment Code
gt Greater than
<!–[if gt mso 14]> Greater than MSO 2010 <![endif]–>
lt Less than
<!–[if lt mso 12]> Less than MSO 2007 <![endif]–>
gte Greater than or equal to
<!–[if gte mso 15]> Greater than or equal to MSO 2013 <![endif]–>
lte Less than or equal to
<!–[if lte mso 11]> Less than or equal to MSO 2003 <![endif]–>
| or
<!–[if mso 9 | mso 10]> If MSO 2000 or 2002 <![endif]–>
! not
<!–[if !mso 9]><!–> If not MSO <!–<![endif]–>

Related

Conditional comments in outlook365 (Win10)

As known Outlook client (Win version) doesn't use div's so I have to use tables. In order to make responsive design, I'm trying to use the hybrid design (as mentioned here https://www.litmus.com/blog/mobile-responsive-email-stacking/)
The problem is that the outlook client (outlook365 on win10) just ignores every syntax of conditional comments, and gives me the same results as if it was Gmail.
I couldn't find any answer. Could it be that Microsoft just removed this feature from their mail client? or am I doing something wrong.
I'll appreciate any idea. Thank you.
This is the HTML I've sent to myself and I got only the lines saying "this is not mso" (both conditions were ignored (the positive and the negative).
<!--[if mso]>
this is mso
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
gte mso 9
<![endif]-->
<!--[if gte mso 16]>
this is mso 16
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
gte mso 9
<![endif]-->
<!--[if !((gte mso 9)|(IE))]><!-- -->
This is not mso 9\ie
<!--<![endif]-->
<!--[if !mso]><!-- -->
This is not mso
<!--<![endif]-->

Bulletproof background image Outlook 2013

I'm trying to put a background image on a table cell in outlook 2013.
I used this from campaign monitor : https://backgrounds.cm/ . It's supposed to work with clients working with the word html engine : outlook 2007, 2010 and 2013.
I got this code and tested it on emailonacid (only this code, nothing else) :
<table>
<tr>
<td background="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2015/11/25/uGNU4M0pzfWehDAXEvq5V6y7/stampready/images/s2_bannerbg.jpg" bgcolor="#0193F9" width="800" height="450" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:800px;height:450px;">
<v:fill type="tile" src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2015/11/25/uGNU4M0pzfWehDAXEvq5V6y7/stampready/images/s2_bannerbg.jpg" color="#0193F9" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
Now let's see the results on https://www.emailonacid.com
As you can see it works perfectly fine on 2007 and 2010, but to my disbelief it won't work on outlook 2013 even with many tries to debug it.
Maybe someone faced that problem before.
edit : as for the duplicate matter, my question concerns a problem where the background image works in 2007/2010 but NOT 2013. This is indeed unique on stack overflow so it is not a duplicate
Test this in an actual version of Outlook 2013. It should display the image.
Tools like Email on Acid and Litmus are essentially virtual machines. Depending on the day or time, their software could capture a screenshot before the email's images have downloaded. + It takes longer to download and display an image using MS's icky VML code.

IE Conditional Statements Displaying in Browser Issue

I have a Bootstrap ASP.NET MVC 4 project and look perfect across all browsers, except for IE 8 on Windows Server 2003.
When viewing the website the text <!--[if lt IE 9 !IE]><![endif]--><!--[if lt IE 9 !IE]><!--<![endif]--><!--[if lt IE 9 !IE]><![endif]--> actually appears on the page, so the browser is ignoring it.
HTML
<!--[if lt IE 9 !IE]>
#Scripts.Render("~/bundles/jqueryold")
<![endif]-->
<!--[if gte IE 9 !IE]><!-->
#Scripts.Render("~/bundles/jquery")
<!--<![endif]-->
#Scripts.Render("~/bundles/bootstrap")
#Scripts.Render("~/bundles/freelance")
<!-- IE8 support for HTML5 elements and media queries -->
<!--[if lt IE 9 !IE]>
#Scripts.Render("~/bundles/ie9")
<![endif]-->
Any help resolving this issue would be much appreciated :-)
The problem is that !IE cancels out your conditional statement.
!IE means "target any other browser EXCEPT IE"
Just get rid of it
<!--[if lt IE 9]>
#Scripts.Render("~/bundles/jqueryold")
<![endif]-->
<!--[if gte IE 9]><!-->
#Scripts.Render("~/bundles/jquery")
<!--<![endif]-->
#Scripts.Render("~/bundles/bootstrap")
#Scripts.Render("~/bundles/freelance")
<!-- IE8 support for HTML5 elements and media queries -->
<!--[if lt IE 9]>
#Scripts.Render("~/bundles/ie9")
<![endif]-->
Check here for more info.

Use HTML to detect IE newer than 7 or other browser

I want to use display A for IE great than 7 or other browsers, and display B for IE 7 and lower.
One way is
<!--[if !IE]>
A
<![endif]-->
<!--[if gte IE 8]>
A
<![endif]-->
<!--[if lt IE 8]>
B
<![endif]-->
But I don't want to write A twice in a page since A is very long and it seems unwise to duplicate it.
How can I achieve this by HTML only?

Is there a conditional CSS If for outlook?

I need some particular css for an html email, but only in outlook.
I'm looking for the outlook equivalent of
<!--[if IE]>body {background-color:red} <![endif]-->
<!--[if gte mso 9]
// This CSS will only be seen in Outlook 2007
![endif]-->