I have a website which does the html form-based mailing-list subscription using jsp as the action target. Here is the snippet of th html form:
------------------------------------------------------
<html>
<title> Bioweircom.org MailingList</title>
<body>
<br>
<center>
<form METHOT=post ACTION=http://www.bioweircom.org/java/jsp/Subscribe.jsp>
 Your Email Address: <input type=text name=email size=30 maxlength=40>
<input type=submit name=action value=subscribe>
&nbsp;&nbsp;
<input type=submit name=action value=unsbscribe>
</form>
</center>
</body>
</html>
------------------------------------------------------

and the snippet of the Subscribe.jsp:
------------------------------------------------------
<%@ page import="java.io.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.mail.Message" %>
<%@ page import="javax.mail.Session" %>
<%@ page import="javax.mail.Transport" %>
<%@ page import="javax.mail.internet.InternetAddress" %>
<%@ page import="javax.mail.internet.MimeMessage" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.naming.InitialContext" %>

<html>
<head>
<%
    String title="Subscribing to bio93@bioweircom.org";
%>
<title> <%= title %> </title>
</head>
<body bgcolor="white">
<center>
<hr color=blue>
<br>

<%
    String email=request.getParameter("email");
    String action=request.getParameter("action");
    if(email==null||email.compareTo("")==0||email.indexOf('@') <= 0){
%>
<font size=+1 color=red>Invalid email address. Click the "Back" button above to subscribe again.</font>
<br><hr color=blue>
</center>
</body>
</html>
<%
        return;
    }
%>
<%
    try {
        // Acquire our JavaMail session object
        Context initCtx = new InitialContext();
        Context envCtx = (Context) initCtx.lookup("java:comp/env");
        Session mailsession = (Session) envCtx.lookup("mail/Session");
        // Prepare our mail message
        Message message = new MimeMessage(mailsession);
        message.setFrom(new InternetAddress(email));
        InternetAddress dests[] = new InternetAddress[]{ new InternetAddress("bio93-request@bioweircom.org") };
        message.setRecipients(Message.RecipientType.TO, dests);
        message.setSubject(action);
        message.setContent("", "text/plain");
        if(action.compareTo("subscribe")==0){
                out.println("You have successfully "+action+"d to<font color=red><strong> bio93@biweircom.org</strong></font>. A confirmation email will be sent to you shortly.<br>");
        }else{
                out.println("You have successfully "+action+"d from<font color=red><strong> bio93@biweircom.org</strong></font>. A confirmation email will be sent to you shortly.<br>");
        }

    } catch (Throwable t) {
        out.println("<font color=\"red\">");
        out.println("ENCOUNTERED EXCEPTION:  " + t);
        out.println("<pre>");
        t.printStackTrace();
        out.println("</pre>");
        out.println("</font>");
    }
%>
<br><hr color=blue><br>
</center>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Above jsp is run within Tomcat-4.0, which can be downloaded from www.apache.org. There is a send-mail sample code coming with the Tomcat download.

Good luck,

Chun-Nuan



Peter Hartzler wrote:
Kevin --

Regarding the questions you sent to me off-list...

The standard way to subscribe to a SL list is to send an email from the
email account you wish subscribed, to the -request address of the list,
with "subscribe" in the subject.

For instance: if your list is called gorp, you might tell your clientele:

Welcome to Gorp, blah blah blah...

To join our email discussion list, send an email to
gorp-request@example.com with the SUBJECT (not body) of your message
reading "subscribe" (without the quotes.)

Hmm... I'm sure this is all covered in the docs. have you been to
http://www.hartzler.net/smartlist/ ?

-ph


On Mon, 26 Nov 2001, Peter Hartzler wrote:

The usual approach is to write a cgi that takes a submitted email address
and creates a subscribe message which it sends to the list-request
address. Quite simple to do if you have any chops at all in web based
apps. You'll want to enable confirmation, to avoid the addition of bogus
email addresses.

On the other hand, pure email based subscription mechanisms such as the
standard SmartList approach aren't that hard -- but I won't ask why you
don't want to go that route. (Odds are someone else on this list will,
however. ;)

-ph

On Mon, 26 Nov 2001, Peterson, Kevin wrote:

I am looking for advice, example, instruction, anything that will help me
create a web-based subscription form
for a smartlist mailing list. I have been looking for hours, and thought
that the members of this forum may be able
to lend a hand.

I am trying to free myself of free e-mail hosts (Topica), and use the
smartlist installed on my web site.

Any help or advice is appreciated.

Kevin S. Peterson


_______________________________________________
Smartlist mailing list
Smartlist@lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/smartlist

_______________________________________________
Smartlist mailing list
Smartlist@lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/smartlist


_______________________________________________
Smartlist mailing list
Smartlist@lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/smartlist