Form on Web Page By Email

R

Rahul Chatterjee

Hello All

I have a web page which has a registration form. The user inputs data in the
form and I would like to be able to send the entire form contents to an
email address (In the HTML format). What is the best and easiest method to
do this? Do I have to capture each element of the form and string it to the
body and then send it out in the page or is there any faster way to grab the
entire contents of the form entirely and attach to the body?

Thanks
 
T

Tyler@Thomson

One of the easiest (though not necessarily best) methods to do this, is to
change the action attribute to "mailto:theEmailAddressHere", method= "post"
enctype="text/plain". However, this will give a resulting email of
name_of_the_form_element=value_of_element. For example:
name=A Name
sex=M
income=Under $25000
Where the name was a text field, sex was a radio button, and income was a
select box. If this seems good enough, I would also suggest throwing in a
Javascript alert window (or something) to let the users know that something
just happened.
Hope that helps
 
A

Adrienne

Hello All

I have a web page which has a registration form. The user inputs data
in the form and I would like to be able to send the entire form
contents to an email address (In the HTML format). What is the best and
easiest method to do this? Do I have to capture each element of the
form and string it to the body and then send it out in the page or is
there any faster way to grab the entire contents of the form entirely
and attach to the body?

Thanks

<%

msg = "<body>"
msg = msg & "<p>Here is the contents of your form:</p>"
msg = msg & "<ul>"
For ix = 1 to Request.Form.Count
field = Request.Form.Key(ix)
InputValue = Request.Form.Item(ix)
msg = msg & "<li>" & field & ": " & InputValue & "</li>"
Next
msg = msg & "</ul>"
msg = msg & "</body>"

'do whatever else you need to do to send mail
%>
 
R

Rahul Chatterjee

This looks good - quick and simple. Is there any way to get the output to
come out in HTML format
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top