【发布时间】:2014-06-28 22:18:35
【问题描述】:
我尝试编写一封用于重置用户密码的电子邮件,并希望在电子邮件中包含我网站的徽标。通过iphone打开邮件时logo可以正确显示,但是通过yahoo.com网站打开并登录邮件时没有任何显示
这是我的邮件:
$message='
<!doctype html>
<html>
<head><meta charset="UTF-8"><title>lsere Message</title></head>
<body>
<header style="border-bottom:2px solid #f0f0f0;padding-bottom:20px;"><div style="margin-top:15px;
box-shadow:1px 1px 10px gray;
border-radius:5px;
width:100px;
margin-left:15px;
text-align:center;
padding-top:5px;
padding-bottom:5px;
color:white;
font-size:25px;
font-weight:bold;
background: -webkit-linear-gradient(#a13030, #780000);
background: -o-linear-gradient(#a13030,#780000);
background: -moz-linear-gradient(#a13030,#780000);
background: linear-gradient(#a13030,#780000);
">
L\'sere
</div>
</header>
<div>
Reset Lsere account password<br>
<div><a href="http://localhost/social_network/reset_password.php">Click here to reset your password</a></div>
<div>Or you can enter your six digits confirmation code and continue on the lese page</div>
<div>Your confirmation code is <span style="background:#f0f0f0; padding:2px;">'.$confirmation_code.' <span></div>
</div>
</body>
</html>';
$headers = 'From: kesongxie646@gmail.com\n';
$headers.='MIME-Version: 1.0'."\r\n";
$headers.='Content-type: text/html; charset=iso-8859-1'."\r\n";
【问题讨论】:
-
你真的认为你可以在电子邮件中使用所有你想要的 CSS 吗?雅虎邮件和许多网络邮件无法处理复杂的 CSS 属性。
-
您要向人们发送以
http://localhost开头的链接?真的吗? -
我仍然在本地计算机上给我的网站发短信@Banana
-
我不太确定它是否相关,但您是否尝试过使用 Internet Explorer 阅读邮件?您可能需要添加
-ms-前缀:background: -ms-linear-gradient(#a13030,#780000);