473,654 Members | 3,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to do email preview on ASP?

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

Jul 3 '06 #1
1 2336
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

Jul 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
15928
by: paii, Ron | last post by:
How do I setup a email with attachment for preview but require the user to push the SEND button in Outlook. I have the following function but it sends the email without the sender ever seeing it. Public Function PrintPDFemail2() ' This will create the PDF if the report is setup for it DoCmd.OpenReport "rptJobItemStat", acViewNormal
7
14358
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to display the graph but it is not possible to send query parameters to an OLE graph on a report (or programatically change any properties of an OLE Graph). However with a Form you do have the ability to change the RowSource of
1
2604
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is viewed in print preview mode by clicking the print preview button, and later closed by clicking on the control X in the top right corner of the preview window, the form simply closes out and there is no more form to be seen, just a blank screen....
2
4346
by: Filips Benoit | last post by:
Dear All, SendObject has no where-argument! How can i email a report having user-defined filter, without opening the report? On a unbound form the user can set the criteria for a report. The where-argument is set depending the user choice. He can output the report as preview, print or email.
5
1669
by: VB Programmer | last post by:
I created a rtf html newsletter editor using ASP.NET. It has a preview button which previews the resulting newletter. The "preview" page basically has tables with labels in it. I fill in the labels with data from the db. Question: How do I email the resulting "preview" page, with everything filled in? Thanks.
0
1771
by: Shawn Mehaffie | last post by:
I am creatign a screen saver and am having a problem with showing the screensaver form in the preview pane. The code works correctly in the the form does display within the preview window. I created a simple for for testing called Preview that only had a label on it and the text "This is a Test" is hardcoded. By doing this I now that it is not other code I have written that is causing this. The problems I am having are: 1) The Preview form...
2
14115
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002 database? Thanks, Dean Slindee
2
992
by: Siv | last post by:
Hi, I am developing an application that produces various printed reports. I use my own custom print preview form and it works pretty well. What I'd like to do to improve it is to allow the user to be able to either print the preview like it does currently, or give them the option to attach it to an email either to the main body of the email, or as an attachment. My thought being that I could probably quite easily save the underlying...
9
4077
by: igotyourdotnet | last post by:
I need to create a print preview page BUT my page I need to print has a grid and in the grid I have 2 or 3 columns that have links I want to hide the columns with the links on my print preview page so they don't print. Is that possible to do and if so can someone point me somewhere or show my a code snippet on how to do this?
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.