当使用PHP邮件功能时邮件在Outlook中不显示图像
当我使用PHP的mail
函数发送邮件时,它适用于Yahoo和GMail帐户,但在Outlook 2007中邮件中使用的图像和背景图像未显示。当使用PHP邮件功能时邮件在Outlook中不显示图像
我怎样才能使它适用于Outlook呢?
我的代码:
<?php
// multiple recipients (note the commas)
$to = "[email protected], ";
// subject
$subject = "Eid Card";
// compose message
$message = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fillon soutient à fond le retour d\'un Grand Prix de France</title>
</head>
<body>
<p>Le Premier ministre François Fillon, passionné d\'automobile et pilote à ses heures, a apporté un soutien appuyé au retour d\'un Grand Prix de France au calendrier 2013 de la Formule 1, en faisant un passage-éclair vendredi sur le circuit Paul Ricard dans le Var.</p>
<img src="http://marvelconcepts.net/email%20of%20eidcard/01.jpg" width="500" height="498">
<div style=" background-image:url(http://marvelconcepts.net/email%20of%20eidcard/01.jpg); width:100px; height:200px; font-size:16px;">
<p>Le Premier ministre François Fillon, passionné d\'automobile et pilote à ses heures, a apporté un soutien appuyé au retour d\'un Grand Prix de France au calendrier 2013 de la Formule 1, en faisant un passage-éclair vendredi sur le circuit Paul Ricard dans le Var.</p> </div>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = "From: Eid Card<[email protected]>\r\n";
$headers .= "Reply-To: [email protected]\r\n";
$headers .= "Return-Path: [email protected]\r\n";
$headers .= "X-Mailer: Drupal\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// send email
mail($to, $subject, $message, $headers);
?>
在Outlook始终显示图片:
我已检查此链接有阻止图像的原因告诉我有没有任何解决方案来显示图像没有阻止消息与PHP – 2012-08-09 09:16:30
Outlook电子邮件客户端不支持HTML格式的电子邮件的背景图像。还有其他一些html和css,以及其他电子邮件客户端不支持的。最好的支持列表是这一个CSS Support The Ultimate Guide
为什么img标签不显示图像在出来看看它在IMG上给文本点击这里下载图像 – 2012-08-09 09:07:51
他们不会自动显示为“安全\隐私”原因 – 2012-08-09 09:10:53
告诉我有没有任何解决方案来显示图像没有阻止消息与PHP – 2012-08-09 09:21:05
您可能需要实际将图像附加到电子邮件;出于安全原因,许多邮件客户端不显示外部图像。 – 2012-08-09 08:50:16
虽然嵌入图像会使它们始终显示,但Outlook根本不支持背景图像。 – 2012-08-09 09:13:31
告诉我是否有任何解决方案来显示图像没有阻止消息与PHP – 2012-08-09 09:24:13