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!

Formating

Status
Not open for further replies.

BikerGal

Programmer
Jul 12, 2002
17
0
0
GB
Hello someone asked me this question. They want the data to be sent in a table in the produced email. Has anyone any ideas? thanks a lot

The code below produces the email below that.
Any ideas how to improve the code so that it is formatted more better?
It goes through each item on each row. This will get very messy when it
gets to be a big order.
<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<%
dim mail_body
mail_body = &quot;Form submitted at &quot;& Now() & vbCrLf & vbCrLf
dim form_element
For each FormElement in Request.Form
mail_body = mail_body & FormElement & &quot;: &quot; & Request.Form(FormElement) &
vbCrLf
Next



dim objCDO
set objCDO = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDO.to =&quot;me@btinternet.com&quot;
objCDO.from =&quot;testOrder@dr.com&quot;
objCDO.Subject = &quot;New Order&quot;
objCDO.Body = mail_body
objCDO.Send
set objMail = nothing
%>
<%response.Redirect(&quot;../secure/logon.asp&quot;)%>
<html>
<head>
<title>mailer</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>

<p>&nbsp;</p>
</body>

-----Original Message-----
From: testOrder@dr.com [mailto:testOrder@dr.com]
Sent: 11 April 2003 12:21
To: me@btinternet.com
Subject: New Order

Form submitted at 11/04/03 12:21:27

OrderID: 259
item: Paracetamol, Ranitidine
form: Syrup, Tablet
size_strength: 500 mg, 150 mg
packSize: 1000, 100
hdnOrderID: 259
cost_pack: £4.00, £50.00
Cost_Item: £12.00, £200.00
quantity: 3, 4
outlet: Church Street, Church Street
staffName: a
Submit: Submit Order
totalCost: £212.00
 
Well, you can send whatever you want.

Take a look at faq215-3358 which allows you to send whatever field you like.

You're putting a lot of information there that doesn't have to all be in separate fields, at least not on the final order form. A final order form, on the line-item-level of detail pretty much needs only:
Stock Number: what you call it there. If you have a 100mg dose and a 500mg dose, call them separate stock numbers. If you have a tablet and liquid form, call 'em separate stock numbers. If they come in the 100-pack and the 1000-pack, call 'em separate stock numbers.
Price per Unit: That's per stock number, mind you.
Quantity: Again, by Stock Number.

If you like, you can add a Total per Line Item or you can just have a Grand Total at the bottom of the form, after you've done all your calculations.

So, that's two things to look at trying.

Cheers,
[monkey] Edward [monkey]

Like Lovecraft? Know Photoshop? Got time for the Unspeakable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top