Firstly, ditch CDONTS and use CDO ...
http://aspfaq.com/show.asp?id=2119
Secondly, to save time and effort, you do not need two pages to send an
e-mail - a single page will suffice.
<%
'// begin p_cdomail.asp
Option Explicit
'// Determines whether to post
sRef = Request.Queryst ring("action")
'// Determine the visitors IP
sVIP = Request.ServerV ariables("REMOT E_ADDR")
Select Case LCase(sRef)
Case "confirm" '// Send the e-mail
'// Get the vars from the post
sName = Request.Form("t xtName")
sMail = Request.Form("t xtMail")
sComments = Request.Form("t xtComments")
'// Code goes here to process and send the e-mail
'// See the following for sending e-mail with CDO
'//
http://aspfaq.com/show.asp?id=2026
Case Else '// Show the form/preview
'// If the form has not been posted, set the forms
'// action query to preview
sAction = "?action=previe w"
'// If the form has not been posted, set the forms
'// submit button value to Preview
btnSubmit = "Preview"
If LCase(sVIP) = "preview" Then '// Show preview
'// Get the vars from the post
sName = Request.Form("t xtName")
sMail = Request.Form("t xtMail")
sComments = Request.Form("t xtComments")
'// Here we can spit them out for previewing
Response.Write "<center>Previe w before
sending</center><br><br> "
Response.Write "<b>Name:</b" & sName & "<br>"
Response.Write "<b>Mail:</b" & sMail & "<br>"
Response.Write "<b>Comment s:</b" & sComments & "<br>"
'// Change the submit buttons value on the form
btnSubmit = "Confirm"
'// Change the forms action query to confirm
sAction = "?action=confir m"
End If
'// Your form goes here
%>
<form method="post" action="p_cdoma il.asp<%=sActio n%>"
name="frmSendMa il">
<input type="text" name="txtName" value="<%=sName %>">
<input type="text" name="txtMail" value="<%=sMail %>">
<input type="text" name="txtCommen ts" value="<%=sComm ents%>">
<input type="submit" name="btnSubmit " value="<%=btnSu bmit%>">
</form>
<%
End Select
%>
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
<bo***********@ gmail.comwrote in message
news:11******** **************@ a14g2000cwb.goo glegroups.com.. .
Hello All
In my ASP page, I use CDONT to send email to client. But, I need to
allow user preview and edit the email content before sending it out.
Any advices?
I have two ASP pages - h_email.asp and h_email_action. asp
Inside the h_email.asp, I create a form and allow user to input
information for the email.
In the h_email_action. asp, it contains asp code for extracting fields'
value in h_email.asp and store them into database as well as send
email. All fields' value will be created as a string for the email
content.
Could anyone give me some suggestions?
Best Regards,
Bon