所以我試圖在這裏傳遞「x」的值,它將生成隨機值。將變量傳遞給mailto主題
<script>
var result = Math.random().toString(36).substring(2,5);
window.onload = function() {
document.getElementById("x").innerHTML=result;
}
</script>
我想將值傳遞給我的html代碼,在mailto主題。所以當人們點擊鏈接,它會自動打開默認的郵件和發送電子郵件的主題爲「特價促銷+(隨機碼)」,以[email protected]
<p style="color: #5b5b5b; text-align: left; id: x;">
<a title="Book Now" href="mailto:[email protected]?subject=Special%20Promotion%20"+x>Book Directly with Us</a></p>
我試圖在調用值編號並在主題中放入「x」,但正如我所料,它不起作用。你們能幫我嗎?我需要知道如何在主題電子郵件中顯示價值。
在此先感謝。
難道你看看這個:http://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-with-using-mailto – Sanj