<script> <br> Date.prototype.toString=function() <br> { <br> var d = new Date(); <br> var ret = d.getYear(); <br> var m = d.getMonth()+1; <br> ret+=m.length>1?m:'0'+m; <br> var date= d.getDate(); <br> ret+=date.length>1?date:'0'+date; <br> return ret; <br> } <br> var initSubject='test'+new Date().toString(),initTo='sample@163.com',initCC='sample@hotmail.com',initBody='use mailto sample'; <br> <br> function submitHandler() <br> { <br> var subject = subText.value; <br> var to = toText.value; <br> var cc = ccText.value; <br> var body = bodyText.value; <br> mailTo.href="mailto:"+to+"?cc="+cc+"&subject="+subject+"&body="+body; <br> mailTo.click(); <br> } <br> function init() <br> { <br> subText.value=initSubject; <br> toText.value=initTo; <br> ccText.value=initCC; <br> bodyText.value=initBody; <br> } <br> </script>