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

simple form - email results

Status
Not open for further replies.

mickeyg

Technical User
Mar 30, 2001
120
US
It has been a long while since I have done ColdFusion.
I would like to email the results of a form and give "a thank you" message.

form declaration is:
<form action=&quot;mailto.cfm&quot; method=&quot;post&quot; name=&quot;mglures&quot; id=&quot;mglures&quot;>

mailto.cfm:
<cfmail from=&quot;#form.emailaddr#&quot; to=&quot;sales@mglures.com&quot; subject=&quot;Order&quot;>

Shipping Information
#form.name# #form.address# #form.emailaddr#

Product Information Color Scent Qty
#form.chunkcolor# #form.chuckscent# #form.chunkqty# #form.crawcolor# #form.crawscent# #form.crawqty# #form.grubcolor# #form.grubscent# #form.grubqty# #form.frycolor# #form.fryscent# #form.fryqty# #form.pachinkocolor# #form.pachinkoscent# #form.pachinkoqty# #form.6flipcolor# #form.6flipscent# #form.6flipqty# #form.6padcolor# #form.6padscent# #form.6padqty# #form.7padcolor# #form.7padscent# #form.7padqty#
</cfmail>

<html>
<head>
<title>Order Confirmation</title>
</head>
<body>

<cfoutput>
<table>
<tr>
<td>Product Description</td>
<td>Color</td>
<td>Scent</td>
<td>Qty</td>
</tr>
</table>

<h2>Thank you #form.firstname# #form.lastname# for your order!</h2>
</cfoutput>

</body>
</html>

Thanks!
Mickey
 
Are you having an error? DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
No error...DUH...I typed in it &quot;Design&quot; view in Dreamweaver not &quot;Code&quot; view. That is what happens sometimes when you are coding at 2am! :eek:

It is working now. My next question is how do I format the email to align my data neatly in columns, carriage returns, etc.

Thanks,
Mickey
 
If you're just using plain text email (the default for CFMAIL) you just lay it out in your code the way you want it to appear in your email... CRLF's and spaces (and I think tabs) are preserved )if tabs aren't, then you just insert #CHR(9)#'s where you want the tabs to be.

OR, you can make it an HTML email (
Code:
<CFMAIL ... type=&quot;HTML&quot;>
) and then you can use HTML tables, et al, to format your output. Of course, a small amount of email clients (nowadays) can't accept HTML emails... so you might want to send a multi-part MIME email with both HTML and plain text components if you need to (see thread232-486389 for more info).



-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top