关闭在html电子邮件中显示的表格标签

时间:2013-02-06 15:13:02

标签: html-email outlook-2003

编辑以添加我的代码。

我为我的公司设计并编写了一个新的html电子邮件模板,我99.99%确定我的所有表格标签都已正确关闭但是当我在Outlook 2003中收到电子邮件时,有两个随机关闭和标签。我通过W3Cs验证器运行了电子邮件的在线版本,所有验证都很好。

以前有人见过这个吗?或者这是我必须忍受的事情以及其他几个与HTML电子邮件有关的问题吗?

可以找到电子邮件的结果here

我的代码:

<!-- Main holding table -->
<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#350d03">
    <tr><!-- Main holding table row -->
        <td><!-- Main holding table data -->
            <!-- Header table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#ffffff" align="center">
                <tr><!-- Spacer row -->
                    <td height="30" width="600"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td width="600" align="center"><a href="http://www.example.co.uk" target="_blank"><img src="linktoimage" alt="Western House Hotel" title="Western House Hotel" border="0" width="312" height="38" /></a></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="600"></td>
                </tr><!-- End spacer row -->
            </table> <!-- End header table -->   
        </td>
    </tr>
    <tr>
        <td>
            <!-- Main image feature table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#ffffff" align="center">
                <tr>
                    <td width="600"><img src="linktoimage" alt="Western House Hotel" title="Western House Hotel" width="600" height="340" /></td>
                </tr>
            </table><!-- End main image feature table -->        
        </td>
    </tr>
    <tr>
        <td>
            <!-- Book direct with us table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#210401" align="center">
                <tr><!-- Spacer row -->
                    <td height="10" width="25"></td>
                    <td height="10" width="400"></td>
                    <td height="10" width="150"></td>
                    <td height="10" width="25"></td>
                </tr><!-- End space row -->
                <tr>
                    <td height="10" width="25"></td>
                    <td width="400" valign="middle"><p style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; margin: 0px 0px 0px 0px; text-transform: uppercase;">For best available rates <span style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight: normal; color: #bb8d09; margin: 0px 0px 0px 0px; text-transform: none;">book direct with us</span></p></td>
                    <td height="10" width="150" align="right"><a href="http://www.example.co.uk" target="_blank"><img src="linktoimage" alt="Visit our website" title="Visit our website" border="0" width="136" height="28" /></a></td>
                    <td height="10" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="10" width="25"></td>
                    <td height="10" width="400"></td>
                    <td height="10" width="150"></td>
                    <td height="10" width="25"></td>
                </tr><!-- End space row -->    
            </table><!-- End book direct with us table --> 
        </td>
    </tr>
    <tr>
        <td>
            <!-- Main content table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#ffffff" align="center">
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="25" width="25"></td>
                    <td height="25" width="550" colspan="3" align="center"><img src="linktoimage" alt="Page divide" width="548" height="18" /></td>
                    <td height="25" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="20" width="25"></td>
                    <td height="20" width="265">
                        <!-- Main feature left table -->
                        <table cellspacing="0" cellpadding="0" width="265" bgcolor="#ffffff" align="center">
                            <tr>
                                <td width="265"><p style="font-size: 20px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: bold; color: #350d03; margin: 0px 0px 0px 0px; text-transform: uppercase;">Special Valentines Package!</p></td>
                            </tr>
                            <tr><!-- Spacer row -->
                                <td height="15" width="265"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td width="265"><p style="font-size: 16px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #bb8d09; margin: 0px 0px 0px 0px;">Stay and dine in the beautiful 4 star Western House Hotel between 9th and 17th February for only &pound;139*!</p></td>
                            </tr>  
                            <tr><!-- Spacer row -->
                                <td height="25" width="265"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td width="265" align="left" valign="middle"><a href="http://www.example.co.uk" target="_blank"><img src="linktoimage" alt="Book Now!" title="Book Now!" border="0" width="114" height="27" /></a></td>
                            </tr>      
                        </table><!-- End main feature left table -->        
                    </td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"><img src="linktoimage" alt="Special Valentines Package" title="Special Valentines Package" width="265" height="175" /></td>
                    <td height="20" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="25" width="25"></td>
                    <td height="25" width="550" colspan="3" align="center"><img src="linktoimage" alt="Page divide" width="548" height="18" /></td>
                    <td height="25" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td width="25"></td>
                    <td width="265">
                        <!-- Sub feature table left -->
                        <table cellspacing="0" cellpadding="0" width="265" bgcolor="#ffffff" align="center">
                            <tr>
                                <td width="265"><img src="linktoimage" alt="Mother's Day Treat" title="Mother's Day Treat" width="265" height="140" /></td>
                            </tr>
                            <tr>
                                <td height="15" width="265"></td>
                            </tr>
                            <tr>
                                <td width="265"><p style="font-size: 17px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: bold; color: #350d03; margin: 0px 0px 0px 0px; text-transform: uppercase;">Mother's Day Treat!</p></td>
                            </tr>
                            <tr>
                                <td height="10" width="265"></td>
                            </tr> 
                            <tr>
                                <td width="265"><p style="font-size: 13px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #7a7a7a; margin: 0px 0px 0px 0px;">Treat your mother to a fantastic dinner and a nights stay in the 4 star Western House Hotel for only &pound;139*!</p></td>
                            </tr>
                            <tr>
                                <td height="25" width="265"></td>
                            </tr>   
                            <tr>
                                <td><a href="http://www.example.co.uk" target="_blank"><img src="linktoimage" alt="Book Now!" title="Book Now!" border="0" width="114" height="27" /></a></td>
                            </tr>    
                        </table><!-- End sub feature table left -->        
                    </td>
                    <td width="20"></td>
                    <td width="265">
                    <!-- Sub feature table right -->
                        <table cellspacing="0" cellpadding="0" width="265" bgcolor="#ffffff" align="center">
                            <tr>
                                <td width="265"><img src="linktoimage" alt="Mother's Day Treat" title="Mother's Day Treat" width="265" height="140" /></td>
                            </tr>
                            <tr>
                                <td height="15" width="265"></td>
                            </tr>
                            <tr>
                                <td width="265"><p style="font-size: 17px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: bold; color: #350d03; margin: 0px 0px 0px 0px; text-transform: uppercase;">Easter Special Offer!</p></td>
                            </tr>
                            <tr>
                                <td height="10" width="265"></td>
                            </tr> 
                            <tr>
                                <td width="265"><p style="font-size: 13px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #7a7a7a; margin: 0px 0px 0px 0px;">Stay in the 4 star Western House Hotel for 2 nights for only &pound;135 per night and 3 nights for only &pound;125 per night**!</p></td>
                            </tr>
                            <tr>
                                <td height="25" width="265"></td>
                            </tr>   
                            <tr>
                                <td><a href="http://www.example.co.uk" target="_blank"><img src="linktoimage" alt="Book Now!" title="Book Now!" border="0" width="114" height="27" /></a></td>
                            </tr>    
                        </table><!-- End sub feature table right -->
                    </td>
                    <td width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="25" width="25"></td>
                    <td height="25" width="550" colspan="3" align="center"><img src="linktoimage" alt="Page divide" width="548" height="18" /></td>
                    <td height="25" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="25" width="25"></td>
                    <td height="25" width="550" colspan="3" align="left"><p style="font-size: 13px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: bold; color: #350d03; margin: 0px 0px 0px 0px;">Terms and conditions</p></td>
                    <td height="25" width="25"></td>
                </tr>
                <tr>
                    <td height="25" width="25"></td>
                    <td height="25" width="550" colspan="3" align="left"><p style="font-size: 11px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #7a7a7a; margin: 0px 0px 0px 0px;">* Based on two guests sharing. ** Per room per night on a dinner, bed and breakfast basis, based on two guests sharing. Subject to availability. Upgrades available.</p></td>
                    <td height="25" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->                   
            </table><!-- End main content table -->                                     
        </td><!-- End main holding table data -->
    </tr><!-- End main holding table row -->                                  
</table> <!-- End main holding table --> 

<!-- Footer spacer table -->
<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#350d03">
    <tr><!-- Footer spacer table row -->
        <td><!-- Footer spacer table data -->
            <!-- Spacer table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#350d03" align="center">
                <tr><!-- Spacer row -->
                    <td height="30" width="600"></td>
                </tr><!-- End spacer row -->
            </table><!-- End spacer table -->
        </td><!-- End footer spacer table data -->
    </tr><!-- End footer spacer table row -->
</table><!-- End footer spacer table -->

<!-- Footer holding table -->
<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#210401">
    <tr><!-- Footer holding table row -->
        <td><!-- Footer holding table data -->
            <!-- Footer table -->
            <table cellspacing="0" cellpadding="0" width="600" bgcolor="#210401" align="center">
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="30" width="25"></td>
                    <td height="30" width="265">
                        <!-- Connect table -->
                        <table cellspacing="0" cellpadding="0" width="265" bgcolor="#210401" align="center">    
                            <tr>
                                <td width="265" colspan="3"><p style="font-size: 20px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #bb8d09; margin: 0px 0px 0px 0px;">Connect with Us</p></td>
                            </tr> 
                            <tr><!-- Spacer row -->
                                <td height="20" width="25"></td>
                                <td height="20" width="15"></td>
                                <td height="20" width="225"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td width="25"><img src="linktoimage" alt="Find us on Facebook" title="Find us on Facebook" width="25" height="25" /></td>
                                <td width="15"></td>
                                <td width="225"><p style="font-size: 12px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; margin: 0px 0px 0px 0px;"><a href="http://www.example.co.uk" target="_blank" title="Find us on Facebook" style="color: #ffffff; text-decoration: none;">facebook.com/westernhousehotel</a></p></td>
                            </tr> 
                            <tr><!-- Spacer row -->
                                <td height="10" width="25"></td>
                                <td height="10" width="15"></td>
                                <td height="10" width="225"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td width="25"><img src="http://www.example.co.uk" alt="Follow us on Twitter" title="Follow us on Twitter" width="25" height="25" /></td>
                                <td width="15"></td>
                                <td width="225"><p style="font-size: 12px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; margin: 0px 0px 0px 0px;"><a href="http://www.example.co.uk" target="_blank" title="Follow us on Twitter" style="color: #ffffff; text-decoration: none;">twitter.com/westernhouseayr</a></p></td>
                            </tr> 
                        </table><!-- End connect table -->  
                    </td>
                    <td height="30" width="20"></td>
                    <td height="30" width="265">
                    <!-- Connect table -->
                        <table cellspacing="0" cellpadding="0" width="265" bgcolor="#210401" align="center">    
                            <tr>
                                <td width="265" colspan="3"><p style="font-size: 20px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #bb8d09; margin: 0px 0px 0px 0px;">Contact Us</p></td>
                            </tr> 
                            <tr><!-- Spacer row -->
                                <td height="20" width="25"></td>
                                <td height="20" width="15"></td>
                                <td height="20" width="225"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td height="25" width="225" colspan="3"><p style="font-size: 12px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; margin: 0px 0px 0px 0px;">01292 294990</p></td>
                            </tr> 
                            <tr><!-- Spacer row -->
                                <td height="10" width="25"></td>
                                <td height="10" width="15"></td>
                                <td height="10" width="225"></td>
                            </tr><!-- End spacer row -->
                            <tr>
                                <td height="25" width="225" colspan="3"><p style="font-size: 12px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; margin: 0px 0px 0px 0px;"><a href="http://www.example.co.uk" target="_blank" title="Send us an Email" style="color: #ffffff; text-decoration: none;">info@westernhousehotel.co.uk</a></p></td>
                            </tr> 
                        </table><!-- End connect table -->
                    </td>
                    <td height="30" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="30" width="25"></td>
                    <td height="30" width="265"></td>
                    <td height="30" width="20"></td>
                    <td height="30" width="265"></td>
                    <td height="30" width="25"></td>
                </tr><!-- End spacer row -->
                <tr>
                    <td height="20" width="25"></td>
                    <td height="20" width="500" colspan="3" align="center"><p style="font-size: 12px; font-family: Verdana, Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; margin: 0px 0px 0px 0px;">Western House Hotel | Craigie Road | Ayr, South Ayrshire | Scotland | KA7 0HA</p></td>
                    <td height="20" width="25"></td>
                </tr>
                <tr><!-- Spacer row -->
                    <td height="20" width="25"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="20"></td>
                    <td height="20" width="265"></td>
                    <td height="20" width="25"></td>
                </tr><!-- End spacer row -->
            </table><!-- End footer table -->
        </td><!-- End footer holding table data -->
    </tr><!-- End footer holding table row -->
</table><!-- End footer holding table -->                       


</body>
</html>

感谢。

2 个答案:

答案 0 :(得分:1)

您需要在Outlook中查看页面代码。它会很混乱,但它至少会告诉你为什么</td>漂浮在那里。可能有一个混乱的跨度或其他东西。

从那里你只需要排除故障,尝试以下一些方法:

  • 设置您的字符集<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  • 尝试<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> doctag

如果这不起作用,请尝试:

  • 删除<p>代码并使用发生问题的<br>来查看Outlook是否处理不同的内容

  • 尝试缩短您的电子邮件,使错误部分保持相同,以查看它是否与您的代码长度相关

并不是说那些东西总是必要的,但是你需要隔离Outlook“不喜欢”的东西,即使解决方案看起来像普通网络标准一样愚蠢。

答案 1 :(得分:0)

您是否尝试过发送正文的内部html?我想把这个作为评论添加,但显然我不能直到我获得更高的声誉。我尝试发送内部html,我没有通过Powershell有任何无关的标签。你准确的发送了吗?