我使用php發送電子郵件。根據我的建議,我有3張圖像作爲表格背景。問題是我在Outlook和Adroid Gmail應用程序中查看時看不到電子郵件圖像。Php電子郵件中未顯示Outllook和Android Gmail中的圖像
下面是使用的代碼:
$headers = "From: Furniture \r\n";
$headers .= "Reply-To: [email protected] \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html><body style="margin: 0;">';
$message .= '<table background="http://mysite.com/emailfinal1.jpg" border="0" width="650" height="506" style="font-family: arial, tahoma;color: black; margin: 0;">
<tr height="308" width="650"><td width="450"></td><td></td></tr>
<tr height="16" width="650" style="font-size:12px;"><td width="450"> </td><td align="left" valign="bottom">'. $first_name . ' ' . $last_name . '</td></tr>
<tr height="16" width="650" style="font-size:12px;"><td width="450"> </td><td align="left" valign="bottom">'. $email . '</td></tr>
<tr height="16" width="650" style="font-size:12px;"><td width="450"> </td><td align="left" valign="bottom">'. $nextdate . '</td></tr>
<tr height="134" width="650"><td width="450"></td><td></td></tr>
</table>
<table background="http://mysite.com/emailfinal2.jpg" border="0" width="650" height="133" style="font-family: arial, tahoma;color: #29468a; margin: 0;">
<tr height="10" width="650"><td width="175"></td><td></td></tr>
<tr height="123" width="650" style="font-size:13px;"><td width="175"> </td><td align="left" valign="baseline"><a href="http://www.mysite.com/unsubscribe.php" target="_blank" style="text-decoration: none;color: #29468a;">UNSUBSCRIBE</a> | <a href="http://www.mysite.com/Terms-And-Conditions.aspx" target="_blank" style="text-decoration: none;color: #29468a;">TERMS & CONDITIONS</a></td></tr>
</table>
<table background="http://mysite.com/emailfinal3.jpg" border="0" width="650" height="60" style="font-family: arial, tahoma;color: #29468a; margin: 0;">
<tr height="20" width="650"><td width="526"></td><td></td></tr>
<tr height="40" width="650" style="font-size:11px;"><td width="526"> </td><td align="left" valign="baseline"><a href="http://www.mysite.com/Contact-Us.aspx" target="_blank" style="text-decoration: none;color: #29468a;">Contact Us</a></td></tr>
</table>';
$message .= "</body></html>";
有何意見?我在錯誤的方向嗎?我想讓電子郵件默認顯示圖像。
我希望我不會依賴圖像,但有些時候這些是唯一的方法。我嘗試過的網站預覽我的電子郵件,事情比我想象的要好:) –