Forum Moderators: mack

Message Too Old, No Replies

form to e-mail asp script?

Some simple advice please

         

furman

9:50 am on May 8, 2003 (gmt 0)

10+ Year Member



Hi,

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

jpjones

9:59 am on May 8, 2003 (gmt 0)

10+ Year Member



Any of the ones you have tried should work.
What happened when you did try them?

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?

DaveN

10:07 am on May 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's Depends on what email service you are using on the server here is one for aspemail

'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

Marcovo

10:14 am on May 8, 2003 (gmt 0)

10+ Year Member



On the Windows platform, the only mail component installed by default is CDONTS so, it's probably better to stick with this.

You can download a simple, generic form processor (3.2KB) from Here [small-business-websites.co.uk]
and then modify it to suit yourself.

DaveN

11:15 am on May 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use javascript to check if anything is in the form field and don't submit until there is.

DaveN

Ps you will start getting forms full of aaa or bbbb