【发布时间】:2016-07-30 00:42:10
【问题描述】:
我正在尝试使用 cfsavecontent 发送一个 html 页面(带有 CSS 格式)。但是,当我通过cfmail 发送变量时,一切正常,除了图像。
<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@hotmail.com" to="email@gmail.com" subject="test email" type="html">
test:
<br /><br /><br />
#YourImg#
<br /><br /><br />
</cfmail>
这显示了用 CSS 格式化的 HTML 表格,但图像看起来好像丢失了。谁能解释一下为什么?
【问题讨论】:
-
当您想在 HTML 电子邮件中嵌入图像时,您只需提供绝对 URL。所以
src属性看起来像http://somedomain.com/imgs/image/jpg而不是/imgs/image.jpg
标签: image coldfusion cfmail