MAILTEST.jsp 2.67 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.cscimport.*,java.util.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*,com.csc.library.mail.*"  %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>TEST.jsp</TITLE>

<link href="CSS/MYNOTE.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF; font-stretch:narrower}
-->
</style>
</HEAD>
<BODY>

<form name="cscform" >
  <table width="35%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#000000">
    <tr>
      <td><table width="100%" border="0"  align="center" cellpadding="0" cellspacing="1" bordercolor="#000000">
        <tr>
          <td colspan="2" bgcolor="#0080C0" align="center">Sendmail</td>
        </tr>
        <tr>
          <td width="98" bgcolor="#0080C0">from</td>
          <td width="242"><input type="text" name="__from" size="40"></td>
        </tr>
        <tr>
          <td width="98" bgcolor="#0080C0">to</td>
          <td width="242"><input type="text" name="__to" size="40"></td>
        </tr>
        <tr>
          <td width="98" bgcolor="#0080C0">cc</td>
          <td width="242"><input type="text" name="__cc" size="40"></td>
        </tr>
        <tr>
          <td width="98" bgcolor="#0080C0">subject</td>
          <td width="242"><input type="text" name="__subject" size="40"></td>
        </tr>
        <tr>
          <td width="98" bgcolor="#0080C0">content</td>
          <td width="242"><textarea name="__content"></textarea></td>
        </tr>
        <tr>
          <td bgcolor="#0080C0" colspan="2" align="center"><input type="submit" value="sendmail"></td>
        </tr>
      </table></td>
    </tr>
  </table>
  <%
  CheckNull chk=new CheckNull();
  ThaiUtilities th=new ThaiUtilities();
  String from=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__from")));
  String to=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__to")));
  String cc=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__cc")));
  String subject=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__subject")));
  String content=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__content")));
  if(from.length()>0 && to.length()>0){
  %>
  <br>from=<%=from%>
  <br>to=<%=to%>
  <br>cc=<%=cc%>
  <br>subject=<%=subject%>
  <br>content=<%=content%>
  <%
		SendMail sm= new SendMail("", from,to,cc,subject,content);
		sm.send();
 	} 
  %>
 
</form>
</BODY>
</HTML>