[thelist] ASP and form question
Sharon F. Malone
sfmalo at 24caratdesign.com
Mon Jul 8 18:08:02 CDT 2002
Hi Lon, Joel, Mahu, and everyone who is trying to help me!!!
Well! Progress. I combined Lon's suggested strBody suggestions with Joel's script (after looking back over Madhu's script)(<8 and changed all the objMail.Body references to strBody followed by objMail.Body = strBody.
I am now getting no compilation errors and the email message I'm getting looks like this:
Sent by:
address:
city:
state:
zip:
homephone:
workphone:
fax:
email:
BestSellers:
SpecialtyGifts:
SeasonalSelections:
CorporateGifts:
PartyFavors:
OtherItems:
Comments:
Progress!!!! The only problem is, it's still not picking up the information I typed into these fields as a test.
Here's the script so far. Maybe I should take out the <input type=hidden fields> in my form. Could that be interfering?
<%
Dim objMail
set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "webmaster at 24caratdesign.com"
objMail.Subject = "Web Site Form Request"
objMail.To = "The Chocolate Factory<sfmalo at 24caratdesign.com>"
objMail.BCC = "cheftrain at yahoo.com"
strBody = "Sent by: " & Request.Form("fullname") & vbCrlf & vbCrlf
strBody = strBody & "address: " & Request.Form("address") & vbCrlf & vbCrlf
strBody = strBody & "city: " & Request.Form("city") & vbCrlf & vbCrlf
strBody = strBody & "state: " & Request.Form("state") & vbCrlf & vbCrlf
strBody = strBody & "zip: " & Request.Form("zip") & vbCrlf & vbCrlf
strBody = strBody & "homephone: " & Request.Form("homephone") & vbCrlf & vbCrlf
strBody = strBody & "workphone: " & Request.Form("workphone") & vbCrlf & vbCrlf
strBody = strBody & "fax: " & Request.Form("fax") & vbCrlf & vbCrlf
strBody = strBody & "email: " & Request.Form("email") & vbCrlf & vbCrlf
strBody = strBody & "BestSellers: " & Request.Form("BestSellers") & vbCrlf & vbCrlf
strBody = strBody & "SpecialtyGifts: " & Request.Form("SpecialtyGifts") & vbCrlf & vbCrlf
strBody = strBody & "SeasonalSelections: " & Request.Form("SeasonalSelections") & vbCrlf & vbCrlf
strBody = strBody & "CorporateGifts: " & Request.Form("CorporateGifts") & vbCrlf & vbCrlf
strBody = strBody & "PartyFavors: " & Request.Form("PartyFavors") & vbCrlf & vbCrlf
strBody = strBody & "OtherItems: " & Request.Form("OtherItems") & vbCrlf & vbCrlf
strBody = strBody & "Comments: " & Request.Form("Comments")
objMail.Body = strBody
objMail.Send
set objMail = nothing
Response.Redirect("http://www.chefsteve.com/chocfoundry/html/confirm.html")
%>
---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com
sfmalo at 24caratdesign.com
----- Original Message -----
From: "lon.kraemer" <lwkraemer at directvinternet.com>
To: <thelist at lists.evolt.org>
Sent: Monday, July 08, 2002 10:21 AM
Subject: Re: [thelist] ASP and form question
> Hi Sharon,
>
> Please DELETE and forget the script that headlemur sent you. It'll only
> confuse you at this point. He showed that to me about 5 years ago. I
> told him it was overkill then. It still is! No offense intended Alan ;)
>
> Here is a VERY simple[0] example that should get you going using the
> CDONTS.NewMail object:
>
> Save this as form.html
> ------------
> <html>
> <head>
> <title>form.html</title>
> </head>
> <body>
> <form action="processform.asp" method="post">
> Full Name: <input type="text" name="fullname"><br>
> Email Address: <input type="text" name="emailaddress"><br>
> Message:<br>
> <textarea cols="40" rows="4" name="message"></textarea><br>
> <input type="submit">
> </form>
> </body>
> </html>
> -------------
>
> Save this as processform.asp
> -------------
> <%
> Dim fromname,fromemail,frommessage,objMail,strBody
> fromname=request.form("fullname")
> fromemail=request.form("emailaddress")
> frommessage=request.form("message")
> Set objMail = Server.CreateObject("CDONTS.NewMail")
> objMail.From = fromemail
> objMail.To = "Sharon F. Malone<sharon at herdomain.com>"
> objMail.Subject = "Form response email"
>
> strBody = "Name: " & fromname & vbCrLf
> strBody = strBody & "...whose email is: " & fromemail & vbCrLf
> strBody = strBody & "...said: " & frommessage & vbCrLf
>
> objMail.Body = strBody
> objMail.Send
> Set objMail = Nothing 'You must always do this with CDONTS.
> Response.Redirect("thanks.html")
> %>
> ------------
>
> Save this as thanks.html
> ------------
> <html>
> <head>
> <title>thanks.html</title>
> </head>
> <body>
> Your email has been sent.
> </body>
> </html>
> -------------
>
> [0] This uses three separate pages, but could easily be just a single
> page. There is no form validation or object error handling. It uses
> minimal object methods.
>
> You might also just be well advised to Google "CDONTS" for more complete
> info.
>
> HTH
> --
> Lon Kraemer
> -----------------------------------------
>
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list