這個 JavaScript 能幫助你快速寄信給他人。只要點一下寄信連結,它就會詢問收件者的電子郵件、主旨等資訊,接著便會開啟一封已經填好的新郵件視窗。
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function mailsome1(){
who=prompt("Enter recipient's email address: ","antispammer@earthling.net");
what=prompt("Enter the subject: ","none");
if (confirm("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true){
parent.location.href='mailto:'+who+'?subject='+what+'';
}
}
// End -->
</SCRIPT>
<a href='javascript:mailsome1()'>E-Mail Someone!</a>
<FORM>
<input type=button value="E-Mail Someone!" onClick="mailsome1()">
</FORM>
以上就是使用 JavaScript 實現自動寄送郵件的程式碼,內容簡單易懂,希望對大家有所幫助。