• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • 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">

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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