WebTeams
7360 Blue Creek West Drive
Indianapolis, IN 46256
317.849.8725

Using OCXMail.OCX with IMail Listserver

To create an "automated" form for subscribing to lists managed by the IMail Listserver, here is what you need.

First, get a copy of OCXMail from Flicks Software. The free version includes a tag that is mailed with each message with a link back to Flicks in it. If you register the program for $39, the tag is removed. Install this program on your NT server.

Create an HTML page with a form in it that includes the following components:

<form ACTION="cgi-bin/subscribe.asp" METHOD="POST">
 <input type="hidden" name="subject" value="Subscribe">
 <input type="hidden" name="listname" value="Mylist">
    Your Name:
 <input TYPE="TEXT" COLS="25" NAME="username" size="29">
Email Address:
 <input TYPE="TEXT" COLS="25" NAME="from" size="29">
 <input TYPE="SUBMIT" VALUE="Subscribe">
</form>

For the purposes of this tutorial, assume your domain name is: MyDomain, and your list is called MyList. So to subscribe you would normally send an email to:
listserv@MyDomain.com

with a message that includes the line:
subscribe MyList UserName, where Username is the person's actual name.

The "form" above calls an ASP called: subscribe.asp. This ASP will send an e-mail message to your listserver with the subscribe information in the body of the message as required by IMail. It looks like this:

<HTML>
<HEAD>
<TITLE>MyDomain List Subscriber</TITLE>
</HEAD>

<%
Set mailer = Server.CreateObject("ASPMAIL.ASPMailCtrl.1")
%>

<!-- put the html code for your page header here -->
<center>
<img src="/images/header.gif"><br clear=all>
<p><font face="verdana" size=5>MyDomain List Subscriber</font>
</center>
<!-- the code between these comments is your own -->

<%
recipient = "listserv@MyDomain.com"
sender = Request.Form("from")
username = Request.Form("username")
subject = Request.Form("subject")
message = "subscribe " & Request.Form("listname") & username
mailserver = "MyDomain.com"
result = mailer.SendMail(mailserver, recipient, sender, subject, message)
%>
<% If  "" = result Then %>

<font face="verdana" size=3>
<p>Congratulations <%= username %>, 
you have been added to the MyDomain Subscriber List. 
Press <a href="http://www.MyDomain.com">here</a> to continue.
</font>

<% Else %>

Mail was not sent, error message is
<H2>
<%= result %>
</H2>

<% End If %>

<!-- put the html code for your page footer here -->

</BODY>
</HTML>

The form sends:

  • "from", the subscriber's e-mail address, must be captured in the form
  • "username", the subscriber's name, not required but nice to have anyway
  • "subject", the subject of the message, the OCX requires it, but you can pass it as a hidden entry from the form, value "Subscribe"
  • "listname", required, passed from the form as a hidden entry, the name of your list (MyList)
  • "message" is generated by this script to send the proper body information
  • "mailserver" is the name of your IMail domain, everwhere this script says: MyDomain, replace with your actual domain name
The combination of the HTML form code above and this ASP file, with additional HTML in the ASP to make the return information look like your website pages, will do the trick nicely.