write.html.svn-base
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:11k
源码类别:

WEB邮件程序

开发平台:

Java

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  5. <title>发送邮件</title>
  6. <style type="text/css">
  7. <!--
  8. .Max {
  9.  width: 100%;
  10. }
  11. -->
  12. </style>
  13. <script language="JavaScript" src="include/CheckDataFunction.js" type="text/JavaScript"></script>
  14. <script language="javascript">
  15.   <!--
  16.  
  17.  function doSendAndSave()
  18.       {
  19.         if(setSend())
  20. {
  21. EditForm.easyJWebCommand.value="sendSave";
  22.          EditForm.submit();
  23. }
  24. else
  25. return false;       
  26.       }//sendsave 
  27.       function doSend()
  28.       {
  29.         if(setSend())
  30. {
  31. EditForm.easyJWebCommand.value="send";
  32.          EditForm.submit();
  33. }
  34. else
  35. return false;       
  36.       }//sendsave
  37.       function doSave()
  38.       {
  39.         if(setSend())
  40. {
  41. EditForm.easyJWebCommand.value="save";
  42.          EditForm.submit();
  43. }
  44. else
  45. return false;       
  46.       }//sendsave
  47.      
  48.       function choiceAddress(Obj)
  49.       {
  50.         var str='';
  51.         urls="address.ejf?easyJWebCommand=choice";
  52.         str=window.showModalDialog(urls,"addAccessory","dialogWidth:500px;dialogHeight:400px;help:no;status:no");
  53.         choice(Obj,str)
  54.    
  55.       }
  56.       function choice(Obj,str)
  57.       {
  58.         var allValue=Obj.value;
  59. if(str!=null)
  60. {
  61. if(allValue!=null && allValue!="")
  62. {
  63. allValue = allValue+",";
  64. }
  65. var tmpValue='';
  66. var Value=str.split('<>');
  67. for(var x=0;x<Value.length;x++)
  68. {
  69.   if(Value[x]!='')
  70.   {
  71. tmpValue=Value[x].split('|')
  72. if(allValue.indexOf(tmpValue[0])==-1)
  73. allValue+= tmpValue[0]+",";
  74.   }
  75. }
  76. }
  77. Obj.value = allValue.substring(0,allValue.length-1);
  78.       }
  79.       function DelCID(Obj)
  80.       {
  81.         for(var x=Obj.length-1;x>=0;x--)
  82.         {
  83.           if(Obj.options[x].selected)
  84.           {
  85.           Obj.options[x]=null;
  86.           }
  87.         }
  88.       }
  89. function changeEdit(obj)
  90. {
  91. if(EditForm.editMode.value == 'html')
  92. {
  93. if(!window.confirm('警告:如果将该邮件格式改为纯文本,可能会造成格式信息丢失!'))
  94. return false;
  95. EditForm.editMode.value = '1';
  96. EditForm.text.value = htmlRichedit.getPureText();
  97. EditForm.richedit.value= htmlRichedit.getPureText();
  98. htmlView.style.display="none";
  99. textView.style.display="";
  100. }
  101. else
  102. {
  103. EditForm.editMode.value = 'html';
  104. htmlRichedit.setHTML('<div><pre>'+EditForm.richedit.value+'</pre></div>');
  105. htmlView.style.display="";
  106. textView.style.display="none";
  107. }
  108. if(obj.innerText=="可视化编辑器")obj.innerText="文本编辑模式";
  109. else obj.innerText="可视化编辑器";
  110. return false;
  111. }
  112. function setSend()
  113. {
  114.         var x,n
  115.         var accessoryValue='<>';
  116.    if(Trim(EditForm.toUser.value)=="")
  117.         {
  118.           alert('请输入收件人');
  119.           EditForm.toUser.focus();
  120.           return false;
  121.         }
  122.         if(EditForm.copyTo.length>=1000)
  123.         {
  124.           alert('邮件最多只能抄送10位接收者!n如要发送给多个人员,请选择多个收件人!');
  125.           EditForm.copyTo.focus();
  126.           return false;
  127.         }
  128.         if(Trim(EditForm.subject.value)=='')
  129.         {
  130.           alert('请输入主题!');
  131.           EditForm.Subject.focus();
  132.           return false;
  133.         }      
  134.        // EditForm.accessory.value =accessoryValue;
  135. if(EditForm.editMode.value=="html")
  136. EditForm.text.value = '<html>'+htmlRichedit.getHTML()+'</html>';
  137. else
  138. EditForm.text.value = EditForm.richedit.value;
  139. // alert(EditForm.text.value);
  140. return true;
  141. }
  142. var fileCount=1;
  143. function addRow(objTable){
  144.  var newfirstRow=" <tr><td width="60">附 件 : </td><td><input type="file" name="file0"></td></tr>";
  145.  var tbodyOnlineEdit=objTable.getElementsByTagName("TBODY")[0];
  146.  alert(tbodyOnlineEdit.innerHTML);
  147.  //里面一个附件都没有
  148.  if(tbodyOnlineEdit.innerHTML==""){
  149.        tbodyOnlineEdit.innerHTML=newfirstRow;
  150.     //tbodyOnlineEdit.insertBefore(elm);
  151.  }else{
  152.  var elm = tbodyOnlineEdit.children[0].cloneNode(true);
  153.  
  154.  elm.id="dataRow"+fileCount++;//设置行的ID 
  155.  //设置表单name 
  156.  elm.children[1].children[0].name="file"+fileCount;
  157.  
  158. // elm.children[2].children[0].name="amountT"+countId;
  159. //插入表单
  160.  tbodyOnlineEdit.insertBefore(elm);
  161.  }
  162. }
  163. //删除附件
  164. function deleteRow(objTable,rowid){
  165.  var tbodyOnlineEdit=objTable.getElementsByTagName("TBODY")[0];
  166.  if(rowid!=""){
  167.  for (var i=tbodyOnlineEdit.children.length-1; i>=0 ;i-- ){
  168.      if (tbodyOnlineEdit.children[i].id==rowid){tbodyOnlineEdit.deleteRow(i)};
  169.    }
  170.    }
  171. }
  172. //-->
  173. </script>
  174. <link href="css/style.css" rel="stylesheet" type="text/css">
  175. </head>
  176. <body bgcolor="#F2F1F2" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" scroll="no" background="images/login_bg.gif">
  177. <div style="overflow: auto;height:100%;width:100%;">
  178.   <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  179.     <tr>
  180.       <td width="11" height="11"></td>
  181.       <td ></td>
  182.     </tr>
  183.   </table>
  184.   <table width="100%" height="98%"  border="0" cellpadding="0" cellspacing="0">
  185.     <tr>
  186.       <td width="11" background="images/1.gif">&nbsp;</td>
  187.       <td align="center" valign="top" bgcolor="ECF4F5">
  188.           <table width="99%" border="0" >
  189.             <form  method="post" enctype="multipart/form-data" name="EditForm"  id="EditForm"  action="email.ejf">
  190. <input type="hidden" name="easyJWebCommand" value="save">
  191. <input type="hidden" name="subCommand" value="">
  192. <input name="editMode" type="hidden" id="editMode" value="html">
  193.             <input name="text" type="hidden" id="text" value="">
  194. <input name="cid" type="hidden" value="">                 
  195. <input name="box" type="hidden" value="draftbox">                 
  196.               <tr>
  197.                 <td ><table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  198.                   <tr align="center"> 
  199.                     <td width="200" align="center" colspan="2"><font color="#FF0000">收件人、抄送人地址请用逗号隔开</font></td>
  200.                     <td width="50" class="coolbutton" style="cursor: hand;" onClick="doSend()"><img  src="images/posts.gif" width="16" height="16" border="0" align="absmiddle">发送</td>
  201.                     <td width="50"></td>
  202.                     <td width="50" class="coolbutton" style="cursor: hand;" onClick="return doSave();"><img  src="images/copyToDisk0a.gif" width="16" height="16" border="0" align="absmiddle">保存</td>
  203.                     <td width="50"></td>
  204.                     <td width="90" class="coolbutton" style="cursor: hand;" onClick="doSendAndSave();"><img  src="images/mail.gif" width="16" height="16" border="0" align="absmiddle">发送并保存</td>
  205.                     <td width="50"></td>
  206.                   </tr>
  207.                   <tr> 
  208.                     <td colspan="1" width="10%" align="center" nowrap class="coolbutton" style="cursor: hand;" onClick="choiceAddress(EditForm.toUser);">收件人:</td>
  209.                     <td colspan="6" width="90%"><input name="toUser" type="text" class="Max" id="toUser" value="">                    </td>
  210.                   </tr>
  211.                   <tr> 
  212.                     <td colspan="1" width="10%" align="center" class="coolbutton" style="cursor: hand;" onClick="choiceAddress(EditForm.copyTo);">抄&nbsp;&nbsp;送:</td>
  213.                     <td colspan="6" width="90%"><input name="copyTo" type="text" class="Max" id="copyTo" value=""></td>
  214.                   </tr>
  215.     <tr> 
  216.                     <td colspan="1" width="10%" align="center" class="coolbutton" style="cursor: hand;" onClick="choiceAddress(EditForm.secretTo);">暗&nbsp;&nbsp;送:</td>
  217.                     <td colspan="6" width="90%"><input name="secretTo" type="text" class="Max" id="secretTo" value=""></td>
  218.                   </tr>
  219.                   <tr> 
  220.                     <td colspan="1" width="10%" align="center">主&nbsp;&nbsp;题:</td>
  221.                     <td colspan="6" width="90%"><input name="subject" type="text" class="Max" id="subject" value=""></td>
  222.                   </tr>
  223.                   <tr> 
  224.                     <td width="10%" colspan="1" align="center">优先级:</td>
  225.                     <td><select name="priority" id="priority" >
  226.                         <option value="3" >一般</option>
  227.                         <option value="1" >高</option>
  228.                         <option value="5" >低</option>
  229.                       </select></td>
  230.                     <td colspan="2">需要已接收回执
  231.                       <input type="checkbox" name="needAutoReply" id="needAutoReply" value="1" >                    </td>
  232.                     <td colspan="2">&nbsp;</td>
  233.                     <td align="center"><a href="#" target="_self" onClick="changeEdit(this);">文本编辑器</a>                    </td>
  234.                   </tr>
  235.                   <tr id="htmlView" style="display:"> 
  236.                     <td colspan="7" width="100%"><iframe id='htmlRichedit' name='htmlRichedit' width="100%" height="350" src="include/inedit.htm"></iframe>
  237.                     <span id="htmlTempSpan" style="display:none"></span></td>
  238.                   </tr>
  239.                   <tr id="textView" style="display:none"> 
  240.                     <td bgcolor="#C1F9FD" colspan="7" width="100%"><textarea id='richedit' name='richedit' cols="82" rows="19" maxlength="1000000" style="width:100% "></textarea></td>
  241.                   </tr>
  242.                   <tr> 
  243.                     <td colspan="7" width="100%">
  244. <table width="100%" border="0" id="attachTable">
  245. <tbody>
  246.                         <tr id="dataRow0"> 
  247.                           <td width="60">附 件 : </td>
  248.                           <td><input type="file" name="file0" contenteditable="false"/>
  249.                               <a href="#" onClick="deleteRow(attachTable,this.parentElement.parentElement.id);" >删除附件</a></td>
  250.                         </tr>
  251. </tbody>
  252.                       </table>                    </td>
  253.                   </tr>
  254.                   <tr>
  255.                     <td colspan="7">当前已有附件:
  256.                        <input name="addAccessory" type="button" class="TableTitle" style="cursor: hand;" id="addAccessory" value="添加附件" 
  257.    onclick="addRow(attachTable);"/>
  258.                       提示:您能发送的邮件附件总容量最大为15M! </td>
  259.                   </tr>
  260.                   <tr>
  261.                     <td colspan="7">&nbsp;</td>
  262.                   </tr>
  263.                 </table></td>
  264.               </tr>
  265.             </form>
  266.       </table></td>
  267.       <td width="11" bgcolor="ECF4F5">&nbsp;</td>
  268.     </tr>
  269.   </table>
  270. <script language="javascript">
  271. if(EditForm.editMode.value!=''&&EditForm.editMode.value=='html')
  272. {
  273. window.setTimeout('eee()',500);
  274. }
  275. function eee()
  276. {
  277. if(EditForm.editMode.value!=''&&EditForm.editMode.value=='html')
  278. {
  279. htmlRichedit.setHTML(EditForm.richedit.value);
  280. }
  281. }
  282. window.setTimeout('document.all("toUser").focus()',1);
  283. </script>  
  284. </div>
  285. </body>
  286. </html>