Solved

Send form in body of email

Posted on 2004-04-07
5
135 Views
Last Modified: 2010-04-09
Hello,
I would like to create a form with several fields in an email rather than a link to a web page with a form.

1: Is it possible to have the recipient fill in the form directly in the email and click submit and have the form emailed back?
2: If so, I would I collect the results, as an email attchment or can they be written to a DB like my SQL on a webserver and perhaps the email can notify me of a form submission.

3: Can you provide an example of what needs to be done please.
form fields: Name [textbox], Phone [textbox], Info Pack [dropdown with option 1, 2 and 3] and submit button.
mailto: example@example.com
Mysql db name: example_db [have only create the bd on the server]
domain: www.mydomain.com

Thank you for your assistance.
[html&DB newbee]
0
Comment
Question by:Tlogix
  • 2
5 Comments
 

Expert Comment

by:Halluzination
ID: 10780574
Sure, TLogix.  

Put this code into a standard HTML file and open it.  

----------------------------------------------------------------------
<HTML>
<BODY>
<FORM METHOD=POST ENCTYPE="text/plain" ACTION="mailto:example@example.com?subject=New Order">

Name:<INPUT TYPE="text" NAME="Name"><BR>
Phone:<INPUT TYPE="text" NAME="Phone"><BR>
Info Pack:<SELECT NAME="Infopack">
<OPTION VALUE="Option 1">Option 1
<OPTION VALUE="Option 2">Option 2
<OPTION VALUE="Option 3">Option 3
</SELECT><BR>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</BODY>
</HTML>

----------------------------------------------------------------------------------------------------------------------------------

An example email you would recieve would be:

Name=example
Phone=1234567890
Infopack=Option1

---------------------------------------------------------

Hope that helps!




0
 

Accepted Solution

by:
Halluzination earned 50 total points
ID: 10780580
By the way, if you want to send that page via email, make sure your email provider has HTML compatability and copy and paste that into your email.  Cheers!
0
 
LVL 17

Assisted Solution

by:dorward
dorward earned 50 total points
ID: 10782052
I very strongly suggest that you do not try to embed forms inside HTML formatted emails. The handling of HTML email between mail clients is rather variable, and you are likely to find that they fail quite frequently.

As for mailto: as a form action... http://www.isolani.co.uk/articles/mailto.html

If you still want to go ahead with this, you need two things.

(1) A real form handler to put at a URL you have in your action attribute. This is written in the language of your choice. My preference would be Perl, many people are happier with PHP, some people even like ASP (and there are other options).

(2) The HTML formatted email. Again, this depends on the language you are working in, my choice would still be Perl. http://perl.about.com/library/weekly/aa042302c.htm
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question