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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" language="java"%>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="cn.js.fan.mail.GetMail"%>
  4. <%@ page import="cn.js.fan.mail.MailMsg"%>
  5. <%@ page import="cn.js.fan.mail.Attachment"%>
  6. <%@ page import="java.util.*"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <link href="../common.css" rel="stylesheet" type="text/css">
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>显示邮件</title>
  13. <style type="text/css">
  14. <!--
  15. body {
  16. margin-left: 0px;
  17. margin-top: 3px;
  18. }
  19. -->
  20. </style></head>
  21. <body>
  22. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  23. <jsp:useBean id="userservice" scope="page" class="com.redmoon.oa.person.UserService"/>
  24. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
  25.   <tr>
  26.     <td width="100%" height="23" class="right-title">&nbsp;&nbsp;查 看 邮 件</td>
  27.   </tr>
  28.   <tr>
  29.     <td valign="top">
  30. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  31. <%
  32. String priv="read";
  33. if (!privilege.isUserPrivValid(request,priv))
  34. {
  35. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  36. return;
  37. }
  38. String email = request.getParameter("email");
  39. String mailserver = request.getParameter("mailserver");
  40. String port = request.getParameter("port");
  41. int intport = Integer.parseInt(port);
  42. String email_name = request.getParameter("email_user");
  43. String email_pwd_raw = request.getParameter("email_pwd");
  44. String mailid = fchar.getNullStr(request.getParameter("mailid"));
  45. if (!fchar.isNumeric(mailid)) {
  46. out.println(fchar.Alert_Back("邮件编号无效!"));
  47. return;
  48. }
  49. GetMail getmail = new GetMail(mailserver,intport,email_name,email_pwd_raw);//pub.zj.jsinfo.net","fgf163","1011");
  50. MailMsg mailmsg = getmail.getMessageOfNum(Integer.parseInt(mailid));
  51. if (mailmsg==null) {
  52. out.println(fchar.p_center("邮件为空!"));
  53. return;
  54. }
  55. String[] Recipients = mailmsg.getRecipients();
  56. %>
  57. <br>
  58.     <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" class="stable">
  59.         <tr class="stable">
  60.           <td width="13%" bgcolor="#C4DAFF" class="stable">发件人: </td>
  61.           <td width="35%" bgcolor="#C4DAFF" class="stable"><a href="pop3_sendmail.jsp?to=<%=mailmsg.getSender()%>&email=<%=email%>"><%=mailmsg.getFrom()%></a></td>
  62.           <td width="15%" bgcolor="#C4DAFF" class="stable"> 发送日期:</td>
  63.           <td width="37%" bgcolor="#C4DAFF" class="stable"><%=(mailmsg.getSentDate()==null)?"":DateUtil.format(mailmsg.getSentDate(), "yyyy-MM-dd HH")%></td>
  64.         </tr>
  65.         <tr class="stable">
  66.           <td bgcolor="#EEEEEE" class="stable">收件人:          </td>
  67.           <td bgcolor="#EEEEEE" class="stable"><%
  68. if (Recipients!=null) {
  69. int rl = Recipients.length;
  70. for (int i=0; i<rl; i++){
  71. out.print(Recipients[i]+"&nbsp;");
  72. }
  73. }
  74. %></td>
  75.           <td bgcolor="#EEEEEE" class="stable">优先级:</td>
  76.           <td bgcolor="#EEEEEE" class="stable">普通</td>
  77.         </tr>
  78.         <tr class="stable">
  79.           <td bgcolor="#EEEEEE" class="stable">附 &nbsp;件:          </td>
  80.           <td bgcolor="#EEEEEE" class="stable"><%
  81.   Vector attachs = mailmsg.getAttachments();
  82.   int size = attachs.size();
  83.   if (attachs!=null && size>0) {
  84.   Enumeration e = attachs.elements();
  85.   while (e.hasMoreElements()) {
  86. Attachment a = (Attachment)e.nextElement();
  87. out.print("<img src=images/attach.gif>");
  88. out.print("<a href='getattach.jsp?email=" + email + "&mailid="+mailmsg.getID()+"&attachnum="+a.getNum()+"'>"+a.getName()+"</a><BR>");
  89.   }
  90.   }
  91.   else
  92.    out.print("无");
  93. %></td>
  94.           <td bgcolor="#EEEEEE" class="stable">抄 送:</td>
  95.           <td bgcolor="#EEEEEE" class="stable">(无)</td>
  96.         </tr>
  97.         <tr bgcolor="#FFFFFF" class="stable">
  98.           <td colspan="4" class="stable">主 题:<%=mailmsg.getSubject()%></td>
  99.         </tr>
  100.         <tr bgcolor="#FFFFFF" class="stable">
  101.           <td colspan="4" class="stable">            <%=mailmsg.getContent()%> </td>
  102.         </tr>
  103.       </table>
  104.       <p><br> 
  105.  </p></td>
  106.   </tr>
  107. </table>
  108. </body>
  109. </html>