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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding user details to a htm attachment

Status
Not open for further replies.

bitsnz

Programmer
Mar 12, 2004
4
NZ
hello all.

I have an asp file that a user enters details on. The details are emailed to their address (that they enter) to confirm their order. The confirmation is in the form of a htm file that is attached to the email. I have all this working except i cant get the details they entered into the confirmation htm file.

Anybody know how i can do this?
 
use filesystem object to change the code of the htm file, however it is not a stream lined way, you would be better off creating the htm doc on the fly and attaching.
 
Do you create the HTML file only because you want to send it as an attachement? If yes: create the HTML message as body text. Don't forget to tell the mail object it is HTML.
I ASPeMail ( you do it like this:

Code:
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.AddAddress "info@tek-tips.com"
[b]Mail.IsHTML = True[/b]
Mail.From = "bill@microsoft.com"
Mail.Subject = "Your ASP forum"
Mail.body = "<font size=+3>Great forum!</form>"
Mail.Send
Set mail = nothing


ttmug.gif
 
Thanks for the tips guys but maybe i havent put enough detail in.

My problem with the user details are that im
using <%=Session( "temp" ) (n)%> (n being the number of the user detail variable) within asp code on the user detail form, and i thought i could use these again to add the details to the htm file attachment, but it doesnt work.
i.e <%=Session ("temp")(14)%> might be the phone number,
<%=Session ("temp")(3)%> might be the cost of product, therefore in my html code im adding
<%=Session ("temp")(n)%> where the appropriate user detail should show.

All confirmation emails will have the confirmation.htm template attached except the user details will be different hence coding on the fly just sounds to tedious and stressing. surely there is a better way. Also creating the body as html instead of an attachment is also an exercise in frustration as the body involves endless sets of tags etc and extra quotation marks for each line added rather than one huge line of body tags
i.e Mail.body = "<tag><tag><another Tag>....etc...etc.."

Any more ideas? have i given a better description?

thanks in advance
 
do you use <%=Session( "temp" ) (n)%> in a file called
confirmation.HTM ?
Some code lines would be nice . . .

ttmug.gif
 
At the moment the code functionality where im using
<%=Session( "temp" ) (n)%> within my ASP file works fine. So i thought if i do the same thing within my confirmation.htm file it would work. But no it doesnt.
I presume my problem comes from using <%=Session( "temp" ) (n)%> as a type of local variable and therefore i cant use it from another file. correct? so what can i do.

heres the code and definitions:

The website is a belgium travel centre site. people order to travel by sea to another destination. they put in details etc and pay for it from the paysite (ogone).

The first page asks about the number of people going, amount of cars going, the date of the travel etc. then they press a button to continue. the next page is a confirmation page just to make sure what they entered previously is correct. behind the scenes, this asp file is creating the temps for each user details

<code>
DIM temp( 60 )

temp(0) = Request.Form("reizigersveld") 'people count going
temp(1) = Request.Form("voertuigenveld")'car count going
temp(2) = Request.Form("reisbestemming")'destination
temp(3) = Request.Form("kostprijs") 'cost in euros
temp(4) = bookdag & "/" & bookmaand & "/" & bookjaar
temp(5) = retourdag & "/" & retourmaand & "/" & retourjaar
temp(6) = vertrekdag & "/" & vertrekmaand & "/" & vertrekjaar
temp(8) = Request.Form("radiobutton")
temp(9) = Request.Form("checkbox")
temp(14)= Request.Form("touroperator")

etc...

</code>

the user then clicks a button to carry on. the next page asks about their personal details etc. Down the bottom of this page are the details mentioned earlier. using the
<%=Session( "temp" )(n)%> format to add in the user details.

<code>

<td><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">Polisnummer :</font></div></td>
<td><div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><%=Session( "temp" )(50)%></font></div></td>

</code>

in the case above <%=Session( "temp" )(50)%> is the policy number of the travel.

from here they are directed to the pay site and the email is sent.

the code at the moment in the confirmation.htm file relevant to my problem is:

<code>

...(other code)

<TD vAlign=middle noWrap align=left colSpan=9 rowSpan=3><FONT
face=Arial color=#000000 size=3><B>Email Confirmation of Polisnr :</B></FONT></TD>
<td><%=Session( "temp" )(50)%></td>

...(other code)

</code>

the above code is a small snippet of code that is similar to the rest of the htm file. basically it says "Confirmation of the Polisy Number:" then using the
<%Session( "temp" )(50)%> logic, it should place the policy number here...BUT IT DOESNT.

the confirmation page (the second page the user goes to) sets up the temp variables (as mentioned above) and the page following uses these variables. so i thought the htm file could do the same. is it because the confirmation attachment is a htm file? does it have to be an asp file?

im lost..completely

any help would be great

cheers foxbox
 
The webserver does not process VBScripts scripts in .HTM files. What happens when you change it in confirmation.ASP?


ttmug.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top