我正尝试使用cfsavecontent
发送html页面(使用CSS格式)。但是,当我通过cfmail
发送变量时,除了图像以外,一切正常。使用CFSaveContent生成html,图像不显示
<cfsavecontent variable="YourImg">
<table class="table_css">
<tr>
<td>
<p> your image is this:</p>
<img src="/imgs/image.jpg">
</td>
</tr>
</table>
</cfsavecontent>
<cfmail from="[email protected]" to="[email protected]" subject="test email" type="html">
test:
<br /><br /><br />
#YourImg#
<br /><br /><br />
</cfmail>
这显示了HTML表格,使用CSS格式化,但图像看起来像缺少。有人可以解释为什么吗?
当您要嵌入HTML电子邮件的图像,你可以简单地提供绝对URL。所以'src'属性看起来像'http:// somedomain.com/imgs/image/jpg'而不是'/ imgs/image.jpg' –