http://www.chrispearson.org/pages/programming/vbscript/Email/sendmail.asp
17h01
Thursday, 28. August 2008

|
This page brings together much of the material discussed in ASP
Email and the review of properties and methods in CDONTS
NewMail.
The
code is shown on the page, but only the relevent parts of it - Look
at the page's source to place it in context - The full code of the
ASP page that sends the email, processmail.asp, is provided on the
page processmail_code.asp.
ASP
Email - main article
|
|
HTML
form to collect message parameters
|
|
The HTML code that submits the message parameters is:
<FORM
ACTION="processmail.asp"
METHOD="post"
ENCTYPE="multipart/form-data"
NAME="frmSendMail"
ID="frmSendMail">
<TABLE WIDTH="100%"
BORDER="0"
CELLPADDING="4"
CELLSPACING="0"
BGCOLOR="#FFFFFF">
<TR>
<TD WIDTH="100">
<IMG SRC="../../../../images/40x40.gif"
WIDTH="100"
HEIGHT="1">
</TD>
<TD>Send yourself an email</TD>
<TD> </TD>
</TR>
<TR>
<TD WIDTH="100"> </TD>
<TD>email address</TD>
<TD>
<INPUT NAME="txtTo" TYPE="text"
ID="txtTo" SIZE="40"></TD>
</TR>
<TR>
<TD> </TD>
<TD>subject</TD>
<TD>Test email created on
28
.
August
<INPUT NAME="txtSubject"
TYPE="hidden"
VALUE="Test email created on
28
.
August
">
</TD>
</TR>
<TR>
<TD> </TD>
<TD>from</TD>
<TD>testmail_Sender
<INPUT NAME="txtFrom"
TYPE="hidden"
ID="txtFrom"
VALUE="testmail_Sender">
</TD>
</TR>
<TR>
<TD> </TD>
<TD>body</TD>
<TD>Hello,<BR>
This message was created on the server<BR>
and transmitted to you at your own request.
<INPUT NAME="txtBody"
TYPE="hidden"
ID="txtBody"
VALUE="Hello,
This message was created on the server
and
transmitted to you at your own request.">
</TD>
</TR>
<TR>
<TD> </TD>
<TD> </TD>
<TD>
<INPUT NAME="cmdSubmit"
TYPE="submit"
ID="cmdSubmit"
VALUE="Send">
</TD>
</TR>
</TABLE>
</FORM>
Clicking
on the Send button submits the form data to the active server page,
processmail.asp. The code from processmail.asp is shown on processmail_code.asp.
|
copyright ©2000
-
2008 Chris Pearson