<%@ page import="java.util.*" %>
<%@ include file="newscfg.jsp" %>

<%  String status="";
    if (request.getParameter("group")!=null &&
       !request.getParameter("group").equals("")) {
       NewsClient news = new NewsClient();
       if (!news.connect(server,user,pw,0)) {
         status="<H1>Can't connect to news server</H1>";
      } else {
         MailMessage msg=new MailMessage(request.getParameter("from"),
           request.getParameter("group"),
           request.getParameter("subject"),
           request.getParameter("msg"));
        news.postMessage(msg);
        status=news.response;
        news.quit();
      }
   }
%>

<HTML>
<HEAD><TITLE>Post to Usenet</TITLE></HEAD>
<BODY BGCOLOR=cornsilk>
<H1>Post to Usenet</H1>
<%= status %><BR>
<FORM ACTION=newspost.jsp METHOD=POST>
<TABLE BORDER=0 WIDTH=50%><TR><TD>
Group:</TD><TD><SELECT NAME=group>
<OPTION VALUE=alt.test>alt.test
<OPTION VALUE=comp.lang.java>comp.lang.java
<OPTION VALUE=comp.lang.java.api>comp.lang.java.api
<OPTION VALUE=comp.lang.java.beans>comp.lang.java.beans
<OPTION VALUE=comp.lang.java.gui>comp.lang.java.gui
<OPTION VALUE=comp.lang.java.programmer>comp.lang.java.programmer
</SELECT>
</TD></TR>
<TR><TD>
From:</TD><TD><INPUT NAME=from>
<FONT SIZE=1>Your e-mail address</FONT>
</TD></TR>
<TR><TD>
Subject:</TD><TD><INPUT NAME=subject><BR>
</TR></TD>
<TR><TD VALIGN=top>
Article:</TD><TD>
<TEXTAREA NAME=msg COLS=80 ROWS=25>
</TEXTAREA>
</TR></TD>
<TR><TD>&nbsp;</TD><TD>
<INPUT TYPE=SUBMIT VALUE=Post>
</TD></TR></TABLE>
</FORM>
</BODY>
</HTML>

