Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Outlook HTML电子邮件页边距_Html_Email_Outlook - Fatal编程技术网

Outlook HTML电子邮件页边距

Outlook HTML电子邮件页边距,html,email,outlook,Html,Email,Outlook,我们有一个wysisyg编辑器,用户在其中编写电子邮件内容并单击发送,因此我们需要HTML尽可能干净。例如: <p><a href="">Nam velit metus</a>, vulputate eget sodales ut, dignissim vehicula nisi. Lorem ipsum@dolor.com sit amet, consectetur adipiscing elit.</p> <p>Nunc phar

我们有一个wysisyg编辑器,用户在其中编写电子邮件内容并单击发送,因此我们需要HTML尽可能干净。例如:

<p><a href="">Nam velit metus</a>, vulputate eget sodales ut, dignissim vehicula nisi. Lorem ipsum@dolor.com sit amet, consectetur adipiscing elit.</p>

<p>Nunc pharetra luctus mi, sollicitudin ultrices lacus iaculis sed. Nam aliquam, tortor id sodales scelerisque.</p>
问题是Outlook已放弃对边距/填充的支持,因此唯一的解决方法是将内容创建为:

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding: 20px 0; text-align: left; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  line-height: 18px;"><a href="">Nam velit metus</a>, vulputate eget sodales ut, dignissim vehicula nisi. Lorem ipsum@dolor.com sit amet, consectetur adipiscing elit.</td>
</tr>
<tr>
<td style="padding: 20px 0; text-align: left; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  line-height: 18px;">Nunc pharetra luctus mi, sollicitudin ultrices lacus iaculis sed. Nam aliquam, tortor id sodales scelerisque.</td>
</tr>
</table>
所以我的问题是,我是否最好尝试一下

编辑wysisyg,使其按生成表格而不是段落 违约首先看看这个,这几乎是不可能的。 或者另一个想法是在发送之前自动编辑HTML源代码,可能检查2个段落并在其间插入空格表,例如

 <p><a href="">Nam velit metus</a>, vulputate eget sodales ut, dignissim vehicula nisi. Lorem ipsum@dolor.com sit amet, consectetur adipiscing elit.</p>

 <!--[if mso]>
 <table cellpadding="0" cellspacing="0" width="100%"><tr><td height="20">&nbsp;</td></tr></table>
 <![endif]-->

 <p>Nunc pharetra luctus mi, sollicitudin ultrices lacus iaculis sed. Nam aliquam, tortor id sodales scelerisque.</p> 

我可能更喜欢这种方法,所以下一个问题是,我最好只将此修复应用于outlook,如上图所示,还是将其应用于所有添加

对于html电子邮件,所有内容都应该在表中。也就是说,您可以将所见即所得的内容插入到一个预先存在的文件中,这样您就可以开始了

据我所知,至少有一家主要的电子邮件服务提供商在所见即所得中使用标记。尝试将此添加到标记中:

outlook a{填充:0;}

我个人不喜欢html中的标签。上面的样式代码可能会解决问题,但我没有费心检查,因为我发现double更容易/更快

以下是垂直间距的3种常用技术:

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td>

&nbsp;<br>      <!-- Some clients will collapse empty rows, so &nbsp; is needed -->
Content here
<br><br>
More content here
<br>&nbsp;


    </td>
  </tr>
</table>

OR

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td style="padding-top:20px; padding-bottom:20px;">

Content here
<br><br>
More content here

    </td>
  </tr>
</table>

OR

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td height="20">&nbsp;   <!-- Some clients will collapse empty rows, so &nbsp; is needed -->
    </td>
  </tr>
  <tr>
    <td>

Content here
<br><br>
More content here

    </td>
  </tr>
  <tr>
    <td height="20">&nbsp;
    </td>
  </tr>
</table>

谢谢@PA我有一个夜猫子在尝试代码块的正确格式。你不能添加一些样式吗?p{margin:0}?不,所有东西都需要内联,gmail会像这样剥离所有代码块。我相信Outlook是唯一一个有标记问题的客户端,所以在大多数情况下,针对头部应该是有效的。