我正嘗試使用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' –