Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.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
Php 雅虎和hotmail html时事通讯邮件问题_Php_Html_Css - Fatal编程技术网

Php 雅虎和hotmail html时事通讯邮件问题

Php 雅虎和hotmail html时事通讯邮件问题,php,html,css,Php,Html,Css,我想用php、html向不同的用户发送时事通讯html。下面是雅虎和hotmail的单独代码。我使用单独的代码是因为我遇到了布局问题,这就是为什么我保留单独代码的原因 下面是雅虎用户的代码 <table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0" class

我想用php、html向不同的用户发送时事通讯html。下面是雅虎和hotmail的单独代码。我使用单独的代码是因为我遇到了布局问题,这就是为什么我保留单独代码的原因

下面是雅虎用户的代码

<table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0" class="img_tbl"> <tr><td>
<img style="border:0;display:block;"  src="" align="top"  /></tr></td>

下面是Hotmail用户的代码

<table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;display:inline-block;" cellpadding="0" cellspacing="0" class="img_tbl"><tr><td>
<img style="border:0;display:block;"  src="" align="top"  /></tr></td>

当我将相同的邮件从yahoo转发到hotmail时,布局和图像会中断。 因为雅虎的代码是不同的


谢谢你的建议,尼克

下面是我发送给yahoo客户端的实际代码,该代码支持yahoo客户端,但在hotmail客户端中断。
你会问我为什么要把同样的邮件从雅虎发送到hotmail,答案是我使用了一个叫做“转发朋友邮件”的概念,这就是为什么我要把同样的邮件转发给我的hotmail朋友

<html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta charset="utf-8">
      <title>abc</title>
      </head>
      <body> 
      <table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0">
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/sf-comedy-cella-20131210-647_c.jpg" alt="sf-comedy-cellar" align="top"  /></a></td><td width="15px"></td></tr><tr></tr><tr><td>&nbsp;</td></tr></tbody></table><table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0">
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/karaoke-night-20131210-705_c-9.jpg" alt="karaoke-night" align="top"  /></a></td><td width="15px"></td></tr><tr></tr><tr><td>&nbsp;</td></tr></tbody></table><table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0" >
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/aoife-o-donovan-20131210-511_c-1.jpg" alt="aoife-o-donovan" align="top"  /></a></td><td width="15px"></td></tr><tr><td align="left"></td></tr><tr><td>&nbsp;</td></tr></tbody></table></td></tr><tr><td><table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0">
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/open-mic-night-20131210-705_c-2.jpg" alt="open-mic-night" align="top"  /></a></td><td width="15px"></td></tr><tr></tr><tr><td>&nbsp;</td></tr></tbody></table><table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0">
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/omg-karaoke-20131210-705_c-16.jpg" alt="omg-karaoke" align="top"  /></a></td><td width="15px"></td></tr><tr></tr><tr><td>&nbsp;</td></tr></tbody></table><table border="0" style="width:248px;float:left;margin:15px 15px 0px 0px;" cellpadding="0" cellspacing="0">
      <tbody style="line-height: 0px;">
      <tr><td><a href="#" style="text-decoration:none;" target="_blank" ><img style="border:0;display:block;"  src="http://newsletter.abc.com/img_new_myevents/beach-blanket-b-20131210-515_c-1.jpg" alt="beach-blanket-babylon" align="top"  /></a></td><td width="15px"></td></tr><tr><td align="left"></td></tr><tr><td>&nbsp;</td></tr>
      </tbody>
      </table>
      </body>
</html>

abc

首先,您的HTML无效。因此,这可能会导致问题。如果没有
tr
td
img
就不能成为
表的直接子表。你为什么要向雅虎和Hotmail用户发送不同的电子邮件?你不能(不应该)像
那样对HTML电子邮件使用内联样式(特别是
float
margin
),许多客户端要么将其删除,要么不正确地呈现,因为电子邮件中的HTML支持仍然非常差。不幸的是,根据电子邮件模板的复杂性,您需要嵌套表来定位和间隔。html邮件只是一种网站(不,不是真的,但仍然…)。因此,请在浏览器中创建布局,确保其有效,然后将其转换为邮件。因为在查看代码时,这不可能像在浏览器中预期的那样工作。。。而且,如果您发布所有的
HTML
;-),也会有所帮助