• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

simple email form

Can you guys give me a simple email form with name, email, comments, clear button,and submit button.

Also, I would like it to use the "Location" command to send the email to http://owndesigns.com/bob/local-boise/contact.html

Thanks in advanced,

{ Removed by Diablo84 - PHP Page Editor }
2 Solutions
<form method=post name=frm1 action=?>
<input type=text name=name value="">
<input type=text name=email value="">
<input type=text name=comments value="">
<input type=Reset name=name value="Submit!">
<input type=Submit name=name value="Clear!">
if ($_POST) {
   $m = "New email:\n\n";
   foreach($_POST as $k=>$v) {
       $m.="$k : $v\n";
mail ("youremail@email.com","New Form Submission!",$m);

$to = "your@emailaddress.com";

if (isset($_POST['message']))
  $message = $_POST['message'];
  $from = $_POST['from'];
  $fromemail = $_POST['fromemail'];
  $headers = 'From: ' . $from . ' <' . $fromemail . ">\r\n";
  $headers .= 'Reply-To: <' . $fromemail . ">\r\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

  mail($to, "Form submitted from your website", $message,$header);


<form method=post action="<? echo "$PHP_SELF"; ?>">
<b>Your name:</b><br>
<input type="text" name="from" size="27">

<b>Your Email:</b><br>
<input type="text" name="fromemail" size="27">

<b>Please add any comments you have below:</b>
<textarea cols="40" rows="10" name="message"></textarea>

<input type="submit" value="Send">
<input type="reset" value="Clear the form">
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now