How can I send an email using a form?
FormToEmail.htm
'Form.
<Form method = "POST" ACTION = "formToEmail. asp">
<P>
Recipient: <Input size = 30 NAME = "recipient" MAXLENGTH = 200>
<P>
Sender: <Input size = 30 NAME = "sender" MAXLENGTH = 200>
<P>
Topic: <Input size = 30 NAME = "subject" MAXLENGTH = 512>
<P>
Content 1: <Textarea rows = 2 COLS = 60 NAME = "messageline1"> </TEXTAREA>
<P>
Content 2: <Textarea rows = 2 COLS = 60 NAME = "messageline2"> </TEXTAREA>
</PRE>
<Input type = submit VALUE ="Send">
FormToEmail. asp
'Process received and sent emails.
<%
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 ")
Mailserver = "www.intels.net"
'Write email server.
Result = mailer. SendMail (mailserver, recipient, sender, subject, message)
%>
<% If "" = result Then %>
Congratulations,Email sent successfully!
<% Else %>
Sorry,An error occurred while sending the email.!
<H2>
<% = Result %>
</H2>
<% End If %>
[1]