<strong>mailto用法</strong> <br>如何使用mailto? <br><strong>1)基本用法</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="53307" class="copybut" id="copybut53307" onclick="doCopy('code53307')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code53307"> <br><a href=mailto:sample@163.com>send email</a> <br> </div> <br>或者 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="45021" class="copybut" id="copybut45021" onclick="doCopy('code45021')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code45021"> <br><form action="mailto:sample@163.com"> <br></form> <br> </div> <br>mailto后跟的是收信人。 <br>可使用参数列表<br> <table class="jbborder"> <tbody> <tr> <td>to</td> <td>收信人</td> </tr> <tr> <td>suject</td> <td>主题</td> </tr> <tr> <td>cc</td> <td>抄送</td> </tr> <tr> <td>bcc</td> <td>暗抄送</td> </tr> <tr> <td>body</td> <td>内容</td> </tr> </tbody> </table> <br>參數傳遞方式同頁之間傳遞值一樣,可以使用查詢字串,也可以用form <br><strong>querystring方式</strong>: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="22995" class="copybut" id="copybut22995" onclick="doCopy('code22995')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code22995"> <br><a href="mailto:sample@163.com?subject=test&cc=sample@hotmail.com&body=use%20mailto%20sample%20">send mail</a> <br> </div> <br><strong>form方式</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="62516" class="copybut" id="copybut62516" onclick="doCopy('code62516')"><u>複製代碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code62516"> <br><form name="sendmail" action="mailto:sample@163.com"> <br><input name="cc" type="text" value=" sample@hotmail.com"> <br><input name="subject" type="text" value="test"> <br><input name="body" type="text" value="use mailto sample"> <br> </form> <br> </div> <br>兩種方式同樣傳遞所有參數。 <br><strong>2)範例說明</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="43953" class="copybut" id="copybut43953" onclick="doCopy('code43953')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code43953"> <br> 程式碼如下:<br> <br> <br> <br><title> Send Email </title> <br> <br><meta name="Author" content=""> <br><meta name="Keywords" content=""> <br><meta name=" Description" content=""> <br> <br><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>function submitHandler() <BR>{ <BR>var subject = subText.value 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; >ccText.value=initCC; <BR>bodyText.value=initBody; <BR>} <BR></script> <br><style> <BR>.label{font-weight:bold;postion:absolute;width :80px;} <BR>.head{font-color:black;font-weight:bold;} <BR>.bd{float:left;width:77px;font-weight:bold;} <BR></style> <br> <br><div class="head">Use mailto Send Email</div> <br><div> <br><span class="label"> Subject:</span><input id="subText" type="text" size="50" value="TM V14.2 Bug Fix Questions_20080221"> <br> </div> <br><div> <br>To:<input id="toText" type="text" size="50" value=""> <br> </div> <br><div> <br>CC:<input id="ccText" type="text" size="50" value=""> <br> </div> <br><div> <br>Body:<textarea id="bodyText" rows="20" cols="100"></textarea> <br> </div> <br><input name="btSend" type="button" value="send email" onclick="submitHandler();"> <br><a href="mailto:" id="mailTo"></a> <br> <br> <br><br> </div>成功者找方法,失敗者找藉口!