emailSend.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:5k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

Java

  1. <%@ page language="java" contentType="text/html;charset=UTF-8"
  2.  session="true" errorPage="err.jsp" %>
  3. <%@ include file="GVinc/gvImport.jsp" %>
  4. <jsp:useBean id="gm" scope="page" class="com.gamvan.tools.Gmail"/>
  5. <%
  6. if(gvUserID<=0){
  7. out.print(prtCenter("您尚未登陆,无权进行此项操作!","userLogin.jsp",1));
  8. out.close();
  9. if(true)return;
  10. }
  11. String userName="", userEmail="";
  12. int userID = TypeChange.stringToInt(request.getParameter("userID"));
  13. if(userID>0){
  14. cuc.setUserID(userID);
  15. cui = (ClubUserItem)cuc.userInfo();
  16. if(cui!=null){
  17. userName = cui.getUserName();
  18. userEmail = cui.getUserEmail();
  19. }
  20. }
  21. String myEmail = "";
  22. if(gvUserID>0){
  23. cuc.setUserID(gvUserID);
  24. cui = (ClubUserItem)cuc.userInfo();
  25. if(cui!=null){
  26. myEmail = cui.getUserEmail();
  27. }
  28. }
  29. // ==================执行发送========================
  30. String content = "";
  31. if(request.getMethod().equals("POST")){
  32. content = ">>"+userName+":你好!n";
  33. content += ">>您的朋友"+gvUserName+"从<"+clubName+">给您发来一封邮件n";
  34. content += ">>以下是详细内容nn";
  35. content +=  request.getParameter("content").trim();
  36. content += "nn>>>>>>本邮件回复地址为:  "+myEmail+"  <<<<<<";
  37. gm.setFromEmail(myEmail);
  38. gm.setFromName(gvUserName);
  39. gm.setToEmail(userEmail);
  40. gm.setToName(userName);
  41. gm.setSubject("来自<"+clubName+">  在线发送的Email");
  42. gm.setContent(content);
  43. gm.setSmtpServer(clubSmtp);
  44. gm.setSmtpID(clubSmtpID);
  45. gm.setSmtpPass(clubSmtpPass);
  46. gm.setSmtpPort(clubSmtpPort); //验证服务器端口
  47. gm.setNeedSSL(clubSmtpSSL); //验证服务器要加密
  48. if(clubSmtpUsePass==1){
  49. gm.setNeedAuth("true");
  50. }else{
  51. gm.setNeedAuth("false");
  52. }
  53. try{
  54. gm.mailSender();
  55. }catch(Exception e){
  56. out.print(e.toString());
  57. }
  58. out.print(OutPrint.prtCenter("<a onclick="javascript:window.close()" href="#">"+gm.getMessage()+"</a>","",0));
  59. //out.print(Gfoot());
  60. out.close();
  61. if(true)return;
  62. }
  63. %>
  64. <html xmlns="http://www.w3.org/1999/xhtml">
  65. <head>
  66. <title><%=clubTitle%></title>
  67. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  68. <link href="./GVimgs/favicon.ico" rel="Bookmark"> 
  69. <link rel="icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  70. <link rel="shortcut icon" href="./GVimgs/favicon.ico" type="image/x-icon" />
  71. <link href="./GVinc/main.css" rel="stylesheet" type="text/css" />
  72. <style type="text/css">
  73. <!--
  74. .style1 {color: #FF0000}
  75. -->
  76. </style>
  77. </head>
  78. <body>
  79. <DIV id="waitDiv" style="LEFT: 40%; VISIBILITY: hidden; POSITION: absolute; TOP: 30%; TEXT-ALIGN: center">
  80. <TABLE cellPadding=6 border=0>
  81. <TBODY><TR><TD align=middle>
  82. <IMG  src="GVimgs/loading.gif" alt="请稍候..." width="30" height="30">
  83. <BR>
  84. <FONT color="red">数据载入中,请稍候...</FONT></TD></TR></TBODY></TABLE></DIV>
  85. <script language="javascript" type="text/javascript" src="GVscript/GVtopCode.js"></script>
  86. <SCRIPT language="javascript">
  87. //提交表单
  88. function postMsg(){
  89. var o=event.srcElement;
  90. o.gvSubmit.value="正在提交...";
  91. o.gvSubmit.disabled=true;
  92. o.gvBack.disabled=true;
  93. }
  94. function checkForm(){
  95. postMsg();
  96. return true;
  97. }
  98. gv_showWait('waitDiv', 1);
  99. </SCRIPT>
  100. <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
  101.   <tr class="tab1">
  102.     <td>
  103. <strong>您的位置</strong>&gt;&gt;<a href="default.jsp" target="_parent">社区首页</a>&gt;&gt;
  104. <a href="main.jsp">进站画面</a>&gt;&gt; 在线发送EMAIL</td>
  105.   </tr>
  106. </table>
  107. <table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
  108. <form name="Gforms" id="Gforms" method="post" action="" onSubmit="return checkForm();">
  109. <tr class="tab2">
  110. <td width="100"><strong>收件人</strong></td>
  111. <td height="22">
  112. <%=userName%><br>
  113. (如果用户注册Email地址不正确将无法收到您的邮件)
  114. </td>
  115. </tr>
  116. <tr class="tab2">
  117. <td height="25"><strong>回复地址</strong></td>
  118. <td width="#">
  119. <span class="style1"><%=myEmail%></span>
  120. <br>
  121. 如果您注册的EMAIL有变动,请更新您的注册资料再来发送Email,否则网友(<%=userName%>)可能无法正确回复您的邮件!
  122. </td>
  123. </tr>
  124. <tr class="tab2">
  125.   <td height="12"><strong>内容</strong></td>
  126.   <td><textarea name="content" cols="60" rows="8" id="content"></textarea></td>
  127. </tr>
  128. <tr class="tab2">
  129.   <td height="25">&nbsp;</td>
  130.   <td>
  131. <input name="gvSubmit" type="submit" id="gvSubmit" value="确定发送" />
  132. &nbsp;&nbsp;&nbsp;&nbsp;
  133. <input type="button" name="Submit" value="关闭窗口"  onClick="javascript:self.close();"/></td>
  134. </tr></form>
  135. </table>
  136. <%=Gfoot()%>
  137. </body>
  138. </html>