Flicks Software's OCXMail ASP Component
Form to email example

Create a file called formToEmail.htm with the following contents:

<FORM METHOD="POST" ACTION="formToEmail.asp">
Message Recipient: <INPUT SIZE=30 NAME="recipient" MAXLENGTH=200>
Message Sender: <INPUT SIZE=30 NAME="sender" MAXLENGTH=200>
Subject: <INPUT SIZE=30 NAME="subject" MAXLENGTH=512>
First Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME="messageline1"> </TEXTAREA>
Second Line Of Message: <TEXTAREA ROWS=2 COLS=60 NAME="messageline2"> </TEXTAREA>
<INPUT TYPE=submit VALUE=" Send ">

then create the ASP file formToEmail.asp to receive the form, and send the email:

Set mailer = Server.CreateObject("ASPMAIL.ASPMailCtrl.1")
recipient = Request.Form("recipient")
sender = Request.Form("sender")
subject = Request.Form("subject")
message = Request.Form("messageline1")
message = message & vbCRLF
message = message & vbCRLF
message = message & Request.Form("messageline2")
' insert your mail server here
mailserver = "your.mailserver.com"
result = mailer.SendMail(mailserver, recipient, sender, subject, message)
<% If "" = result Then %>
Mail has been sent.
<% Else %>
Mail was not sent, error message is
<%= result %>
<% End If %>

Applies To

OCXMail ASP Component