|
This
is the code for the entire ASP web page:
<%@LANGUAGE="VBSCRIPT"
CODEPAGE="1252"%>
<head>
<title>Process output from HTML form and send an email</title>
</head>
<body>
<FONT COLOR="#000000" SIZE="2" FACE="Verdana,
Arial, Helvetica, sans-serif">This
shows the parameters passed for the current email message:<BR>
<BR>
</FONT>
<TABLE WIDTH="80%" BORDER="0" CELLPADDING="4"
CELLSPACING="0" BGCOLOR="#CCCCCC">
<TR>
<TD WIDTH="34%"><FONT COLOR="#000000"
SIZE="2" FACE="Verdana, Arial, Helvetica, sans-serif">email
from</FONT></TD>
<TD WIDTH="66%"> <FONT COLOR="#000000"
SIZE="2" FACE="Verdana, Arial, Helvetica, sans-serif">
<% =request("txtFrom") %>
</FONT></TD>
</TR>
<TR>
<TD><FONT COLOR="#000000" SIZE="2"
FACE="Verdana, Arial, Helvetica, sans-serif">email
to</FONT></TD>
<TD><FONT SIZE="2" FACE="Verdana, Arial,
Helvetica, sans-serif">
<% =request("txtTo") %></FONT></TD>
</TR>
<TR>
<TD><FONT COLOR="#000000" SIZE="2"
FACE="Verdana, Arial, Helvetica, sans-serif">subject</FONT></TD>
<TD><FONT SIZE="2" FACE="Verdana, Arial,
Helvetica, sans-serif">
<% =request("txtSubject") %></FONT></TD>
</TR>
<TR>
<TD><FONT COLOR="#000000" SIZE="2"
FACE="Verdana, Arial, Helvetica, sans-serif">body</FONT></TD>
<TD><FONT SIZE="2" FACE="Verdana, Arial,
Helvetica, sans-serif">
<%
=request("txtBody") %></FONT></TD>
</TR>
</TABLE>
<%
'
' This sends the email message
'
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.To = Request("txtTo")
objNewMail.From = Request("txtFrom")
objNewMail.Subject = Request("txtSubject")
objNewMail.Body = Request("txtBody")
objNewMail.BodyFormat = 1
objNewMail.MailFormat = 1
objNewMail.Send
Set objNewMail = Nothing
%>
<P><FONT COLOR="#FF0000" SIZE="2" FACE="Verdana,
Arial, Helvetica, sans-serif"><STRONG>Email
sent to <% =Request("txtTo")
%></STRONG></FONT></P>
<P><FONT COLOR="#000000" SIZE="2" FACE="Verdana,
Arial, Helvetica, sans-serif">
<A HREF="sendmail.asp">Return to sendmail.asp page</A>
</FONT></P>
</body>
</html>
|