2016-11-10 149 views
0

我開發了HTML電子郵件模板並導入到Mailchimp。它在測試模式下工作完美。當我發送它時,Gmail,Outlook和Windows Mail在加載CSS樣式時遇到問題。它只顯示HTML。HTML電子郵件模板Mailchimp,Outlook和Gmail中的CSS問題

然後我試着用沒有鏈接CSS的表格進行開發,在Mailchimp測試和Gmail,Outlook和Windows Mail問題中再次完美。因爲甚至沒有加載表格的STYLE屬性。

請幫忙。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title>Email Design</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/> 
</head> 
    <body style="margin: 0; padding: 0;"> 
<table align="center" border="1" cellpadding="0" cellspacing="0" width="600" background="img/beton.jpg" style=""> 
<tr> 
    <td > 
<img src="img/logo.png" alt="Creating Email Magic" width="160" height=auto align="right" style="padding: 49px 60px; 0 0; left:548px; display: block;" /> 
<a href="facebook.com"><img src="img/facebook.png" alt="Creating Email Magic" width="50" height=auto align="right" style="padding: 39px 0px 0 0px; 0 0; left:548px; display: block;" /></a> 
     <img src="img/newsletter_h1.png" alt="Creating Email Magic" width="342" height=auto align="left" style="padding: 0px 00px; 0 0; display: block;" /> 


</td> 
</tr> 
<tr> 
    <td > 
    Row 2 
    </td> 
<tr> 
    <td > 
    Row 3 
    </td> 
</tr> 
</table> 

     <div></div> 
</body> 




</html> 
+2

你可以發佈你的代碼嗎? – 2016-11-10 10:39:17

+0

電子郵件與網頁不一樣。電子郵件就像構建表格HTML4網頁一樣。這裏是電子郵件客戶端支持的CSS指南:https://www.campaignmonitor.com/css/ - 還有它值得用類似電子郵件的方式測試你的電子郵件:https://www.emailonacid.com/ – Andrew

+0

有編碼電子郵件模板時有很多限制,您應該查看關於電子郵件客戶端支持> https://templates.mailchimp.com/resources/email-client-css-support/的mailchimps文檔。您還應該重置填充/頁邊距所有你的​​的,也避免使用簡短的CSS。 –

回答

0

也許問題在郵件中的標題類型。請按照以下方式檢查您的標題。

// Always set content-type when sending HTML email 
$headers = "MIME-Version: 1.0" . "\r\n"; 
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 
相關問題