<%@ page language="java" errorPage="error.jsp" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/email.tld" prefix="mail" %>
<%@ include file="../demoUtil.jsp" %>

<b><font color="red">
HACKED Security Note - PLEASE READ!
</font></b>
<br>
This demo is intentionally not set up to run out-of-the-box. To get it running, please do the following:
<ul>
<li>modify the host name in the source file "sendmail.jsp" by replacing the value of "your-smtp-host-please-change".
<li>modify the sendmail.properties file to determine what level of attachment support you want. The valid options are "none", "client", "server". The default is "none", for security reasons. To run this demo, you will need to set it to "client".
</ul>
In both of these cases, they are not settable directly on this page in order to avoid the security risk of email system abuse. You will need to make these modifications outside of this demo and then restart the demo for the changes to take effect.
<br>
Please do not let this web page run in a publicly available site in order to avoid unauthorized people from abusing the email system, as there is no authentication and authorization involved in the page. 
<hr>
<BODY BGCOLOR="#FFFFFF">
<hr>
<%
String hostname = "your-smtp-host-please-change";
%>
<br>Hostname:<%=hostname%>
<br>From:<%=request.getParameter("sender")%>
<br>To:<%=request.getParameter("recipient")%>
<br>Cc:<%=request.getParameter("cc")%>
<br>Bcc:<%=request.getParameter("bcc")%>
<br>Subject:<%=request.getParameter("subject")%>
<hr>
<P>Result:

       <mail:sendMail host='<%=hostname%>'
             sender='<%=request.getParameter("sender")%>'
             recipient='<%=request.getParameter("recipient")%>'
             cc='<%=request.getParameter("cc")%>'
             bcc='<%=request.getParameter("bcc")%>'
             subject='<%=request.getParameter("subject")%>'
             clientAttachment='<%=request.getParameter("clientAttachment")%>'>
             <%=request.getParameter("body")%>
       </mail:sendMail>
<HR>
The following email was sent out successfully!<br>
host='<%=util.HTMLReplace(hostname)%>'<br>
sender='<%=util.HTMLReplace(request.getParameter("sender"))%>'<br>
recipient='<%=util.HTMLReplace(request.getParameter("recipient"))%>'<br>
cc='<%=util.HTMLReplace(request.getParameter("cc"))%>'<br>
bcc='<%=util.HTMLReplace(request.getParameter("bcc"))%>'<br>
subject='<%=util.HTMLReplace(request.getParameter("subject"))%>'<br>
<%
if (request.getParameter("clientAttachment")==null)
{
%>
Attachments:none
<%
}
if (!(request.getParameter("clientAttachment")==null))
{
%>
clientAttachment='<%=util.HTMLReplace(request.getParameter("clientAttachment"))%>'<br>
<%
}
%>
body='<%=request.getParameter("body")%>'<br>
<HR>
</BODY>
</HTML>

