Php codeigniter在邮件中显示徽标

Php codeigniter在邮件中显示徽标,php,html,css,codeigniter,Php,Html,Css,Codeigniter,我创建了一个带有内嵌css的HTML页面,并提供了作为内嵌css背景的徽标 <div id="logo_image" style='background: url("<?=base_url();?>assets/images/img2.png") no-repeat scroll 0 0 / 150px auto rgba(0, 0, 0, 0);height: 73px;margin: -15px 0 0;position: absolute; width: 160px;'&

我创建了一个带有内嵌css的HTML页面,并提供了作为内嵌css背景的徽标

<div id="logo_image" style='background: url("<?=base_url();?>assets/images/img2.png") no-repeat scroll 0 0 / 150px auto rgba(0, 0, 0, 0);height: 73px;margin: -15px 0 0;position: absolute; width: 160px;'></div>
$name
包含一些要显示在模板
register.php

除了没有显示徽标外,其他一切都很好

备注:我正在使用
localhost

而不是使用:

<img src="<?=base_url();?>assets/images/img2.png" style="float: left;margin-top: -11px;width: 100px;margin-left:10px;" />
assets/images/img2.png”style=“float:左;利润上限:-11px;宽度:100px;左边距:10px;" />
尝试使用:

<img src="<?php echo base_url();?>assets/images/img2.png" style="float: left;margin-top: -11px;width: 100px;margin-left:10px;" />
assets/images/img2.png“style=“float:left;边距顶部:-11px;宽度:100px;边距左侧:10px;”/>
我用完整的php标记替换了


我知道它有时会引起问题,所以我总是使用完整标签。

答案在你自己的问题中。您正在从localhost/ur localmachine发送邮件。当你在你的本地机器上发送带有图像或导入的css或js的邮件时,gmail或任何其他邮件都无法将其解释为正确的url

所以它所做的就是在它之前附加它自己的url,就像
https://ci3.googleusercontent.com/proxy/..some 链接#http://localhost/assets/images/img2.png


因此,在您将项目上传到域中之前,您的图像不会显示。

哦,是的。。。很抱歉忘了换那个。。。我将尝试查看电子邮件的来源,然后检查指向图像的链接是否为1,是否正确,以及当您转到该链接时是否指向图像的链接是否为2。这是我能想到它不起作用的唯一其他原因。如果我向gmail id发送邮件,它会在指向我的链接的url前面加上前缀。@dhpratik不使用短标记的原因:
我也这么想,但只是想在将项目上传到我的服务器之前确认一下。
<img src="<?=base_url();?>assets/images/img2.png" style="float: left;margin-top: -11px;width: 100px;margin-left:10px;" />
<img src="<?php echo base_url();?>assets/images/img2.png" style="float: left;margin-top: -11px;width: 100px;margin-left:10px;" />