Forum Moderators: mack
Can someone direct me to a form to e-mail asp script please.
I have searched google, aspin and hotscripts and I have tried several but it doesn't seem to work - I am a bit confused by the scripts and what I should put where. All I basically want is a few fields for name, address, e-mail, telephone and a comments box (text area).
Thanks
Fur
It may be that your server does not have the email component that the script requires.
Typical ASP smtp components are CDONTS, ASPEmail, ASPMail, and JMail. There are, of course, more.
It could be worth contacting your hosting company (or look on their support page) to find out which components they support.
An quick overview of what the form to mail code should do is:
1) Read all the values from the posted form
2) Format an email body using the form values as appropriate (e.g. put them in an order if required, or only write the values if the associated form field was filled in)
3) Set the From: address, the To: address, and the Subject
4) Send email
5) Display success page, or redirect to another script.
It's quite simple to roll your own script. It can take about 10 lines of code to email the form details. First off - find out what components your hosting company supports!
HTH,
JP
This thread should perhaps be moved the Microsoft Related - .NET and ASP forum instead?
'recipient
mailto="user@yourdomain.co.uk"
'mail string header
order = order & "Online Booking" & chr(13)& chr(10)
order = order & "==============" & chr(13)& chr(10)& chr(13)& chr(10)
'customer details
details = details & "Customer Details" & chr(13)& chr(10)
details = details & "----------------" & chr(13)& chr(10)
details = details & "Name : " & Request("contact") & chr(13)& chr(10)
details = details & "E-Mail : " & "mailto:" & Request.Form("email")& chr(13)& chr(10)
'create mail object
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.yourmailserver.co.uk"
Mail.IsHTML = false
'build mail content from strings defined above
Mail.Fromname = Request.Form("cus_name")
Mail.Subject = "Online Booking"
Mail.Body = order & details & orderd
Mail.AddAddress + mailto
On error resume next
Mail.Send
That's the asp apart I'm sure you can workout the form part
dave
You can download a simple, generic form processor (3.2KB) from Here [small-business-websites.co.uk]
and then modify it to suit yourself.