opmail.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312" language="java"%>
  2. <%@ page import="fan.mail.GetMail"%>
  3. <%@ page import="java.util.*"%>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  7. <title>邮件操作</title>
  8. <link href="../common.css" rel="stylesheet" type="text/css">
  9. </head>
  10. <body>
  11. <jsp:useBean id="cfgparser" scope="page" class="fan.util.CFGParser"/>
  12. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  13. <jsp:useBean id="userservice" scope="page" class="com.redmoon.oa.person.UserService"/>
  14. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  15. <%
  16. String priv="read";
  17. if (!privilege.isUserPrivValid(request,priv))
  18. {
  19. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  20. return;
  21. }
  22. %>
  23. <table width="" border="0" align="center" cellpadding="0" cellspacing="0">
  24.   <tr> 
  25.     <td height="23" valign="bottom" background="../images/tab-b6-top.gif">     <span class="right-title">删 
  26.       除 邮 件</span></td>
  27.   </tr>
  28.   <tr> 
  29.     <td height="300" valign="top" background="../images/tab-b-back.gif"> 
  30.       <table width="98%" border="0" cellspacing="0" cellpadding="0">
  31.         <tr> 
  32.           <td> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  33.               <tr> 
  34.                 <td align="center"><br>
  35. <%
  36. String op = fchar.getNullStr(request.getParameter("op"));
  37. String[] mailids = request.getParameterValues("mailids");
  38. cfgparser.parse("config.xml");
  39. Properties props = cfgparser.getProps();
  40. String mailserver = props.getProperty("mailserver");
  41. String pop3_port = props.getProperty("pop3_port");
  42. String[] r = userservice.getUserEmailNamePwd(privilege.getUser(request));
  43. if (r==null) {
  44. out.println(fchar.p_center("你的请邮箱尚未开通,请向管理员申请!"));
  45. return;
  46. }
  47. int port = Integer.parseInt(pop3_port);
  48. String email_name = r[0];
  49. String email_pwd_raw = r[1];
  50. if (op.equals("del")) {
  51. if (mailids!=null) {
  52.         //GetMail getmail = new GetMail("202.102.4.20","welcome@zjpages.com","tengtu818");
  53. GetMail getmail = new GetMail(mailserver,port,email_name,email_pwd_raw);
  54. if (getmail.delMessageOfNum(mailids)) {
  55. out.println(fchar.Alert_Back("删除邮件成功!"));
  56. }
  57. else {
  58. out.println(fchar.Alert_Back("删除邮件未能成功!"));
  59. }
  60. }
  61. }
  62. %>
  63.                   <br> </td>
  64.               </tr>
  65.             </table></td>
  66.         </tr>
  67.       </table>
  68.       <p></p></td>
  69.   </tr>
  70.   <tr> 
  71.     <td height="9"><img src="../images/tab-b-bot.gif" height="9"></td>
  72.   </tr>
  73. </table>
  74. </body>
  75. </html>