Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send form data so it is received as an HTML page? 1

Status
Not open for further replies.

Nottoobright

Technical User
Oct 10, 2001
17
0
0
GB
Hi,
I have a form that the user fills in with data and then uses a calculate button at the bottom to add up the entered costs. The user has to be able to enter an email address click send and the form will be sent to that address.

How do I do it so that the reciever will recieve the form in the same format as it was sent ie. the web page complete with data, so that it makes sense.

Can anyone help?

Thanks.
 
Yes, when building that HTML string for the email, quotes / double quotes can get tricky. Try something like this.


<%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = True %>
<%
dim formVal
dim mail

formVal = Request.Form(&quot;d1&quot;)

set mail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
mail.to = &quot;pk068917@stmail.staffs.ac.uk&quot;
mail.from = &quot;pk068917@stmail.staffs.ac.uk&quot;
mail.subject = &quot;TEST HTML Mail&quot;
mail.body = &quot;<html><head></head><body>&quot; _
& &quot;<font size='3' color='#FF0000'><strong>&quot; _
& &quot;Hello, this is an HTML email from &quot; & formVal & &quot;!&quot; _
& &quot;</font></strong>&quot; _
& &quot;</body></html>&quot;
mail.BodyFormat = 0
mail.MailFormat = 0
mail.send
set mail = Nothing
%>




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top