【问题标题】:HTML email template (if / else Outlook or not) not workingHTML 电子邮件模板(if / else Outlook or not)不起作用
【发布时间】:2018-11-12 21:05:04
【问题描述】:

我目前正在尝试为我的 html 电子邮件布局构建一个 if / else 以包含不同的表格标签。这就是我正在尝试的:

<!--[if mso]>
<table class="content-table" role="presentation" cellpadding="0" cellspacing="45" align="center" border="0">
<![endif]-->
<!--[if !mso]> <!---->
<table class="content-table" role="presentation" cellpadding="0" cellspacing="0" align="center" border="0">
<!-- <![endif]-->
</table>

因此,如果邮件在 Outlook 中打开,我会尝试使用不同的 beginn 标记开始我的表格。但这不起作用。怎么了?

这不是重复的!

【问题讨论】:

  • 这个的 php 在哪里?如果您正在使用一个表格,则可能是一个表格。
  • 它位于我的 Linux V-Server Ubuntu 16.4 上
  • @IdontDownVote 抱歉,但这不是重复的。我从那里得到了我的改变,但它没有像预期的那样工作。只是想问一下,可以屏蔽你吗?

标签: html email


【解决方案1】:

这是一个如何在 Outlook 中显示和隐藏的示例。如果您在 Outlook 中查看此内容,您将看到“Outlook”一词。如果您在现代电子邮件客户端中查看它,您会看到“现代电子邮件”字样。

https://jsfiddle.net/wallyglenn/5hruzos5/1/

<table>
<tr>
    <td>
        <!--[if !mso]><!-- -->
        <img src="http://via.placeholder.com/300x300/0000ff/?text=Modern+Email" alt="Modern+Email" width="100%" style="display:inline-block;border:none;outline:none;padding:0;margin:0;width:100%;height:auto;" border="0" hspace="0" vspace="0">
        <!--<![endif]-->
        <!--[if gte mso 9]>
        <img src="http://via.placeholder.com/300x300/ff0000?text=Outlook" alt="" width="100%" style="display:inline-block;border:none;outline:none;padding:0;margin:0;width:100%;height:auto;" border="0" hspace="0" vspace="0">
        <![endif]-->
    </td>
</tr>
</table>

祝你好运。

【讨论】:

  • OMFG 谢谢!我以为我讨厌 IE,我这几天一直在围绕 Outlook 编码。让 IE 显得友好而热情。
猜你喜欢
  • 2016-05-11
  • 2014-04-17
  • 2013-05-31
  • 1970-01-01
  • 2018-12-25
  • 2015-06-28
  • 2013-02-28
  • 2016-10-05
  • 1970-01-01
相关资源
最近更新 更多