【问题标题】:My html logo can not work in email我的 html 徽标无法在电子邮件中使用
【发布时间】: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);

标签: php html css email


【解决方案1】:

你的 Iphone 已经扩展了对复杂 CSS 的支持,但是就像 Vincent 说的,webmail 不提供对如此复杂的支持的扩展支持,当你想到它时,我知道浏览器不会支持它。

所以你最好放弃 CSS 版本,开始考虑实际插入图片。

【讨论】:

  • Anytime :) 如果这样做的全部目的是将您的图像转换为代码,您始终可以将您的图像转换为 Data-URI Base-64 代码。这是一个可以为您做到这一点的网站duri.me
猜你喜欢
  • 2016-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-25
  • 1970-01-01
  • 2017-02-04
  • 2015-09-13
相关资源
最近更新 更多