• 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,

Bob
{ Removed by Diablo84 - PHP Page Editor }
0
weikelbob
Asked:
weikelbob
2 Solutions
 
PromethylCommented:
<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!">
</form>
<?
if ($_POST) {
   $m = "New email:\n\n";
   foreach($_POST as $k=>$v) {
       $m.="$k : $v\n";
   }
mail ("youremail@email.com","New Form Submission!",$m);
}
?>
0
 
edyonlineCommented:
<?php

$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">
<p>

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

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

<p><br>
<input type="submit" value="Send">
<input type="reset" value="Clear the form">
</form>
0
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