How to create a form in a web page with HTML

I want to create a web page in which a form allows the user to insert some personal informations (name surname, phone, etc.) and send them to me in my email box (see
How is it possible with HTML?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The easiest way is set the action of the form as your email address like
<form method="post" 
<input type=text 
<input type=submit 
   value="Submit Your Comments">

Open in new window

Andrew DoadesIT TechnicianCommented:
The above will open a new email windows for the user, I have attached some code for a form.html file and a php mailer script, although they look messy they work!

Hope they work for you!
<form method="POST" action="mailer.php">
          <table border="0" ALIGN="CENTER" cellpadding="5" cellspacing="0" align="center" style="font-family: Tahoma; font-size: 9pt;">
          <td align="left">Your Name:</td>
          <td align="left" valign="middle"><input type="text" name="name" size="35" style='width: 300px;'>
          <td  align="left">Your
          Email Address:</font></td>
          <td  align="left" valign="middle"> <input type="text" name="email" size="35" style='width: 300px;'>
          <td  align="left">Subject:</font></td>
          <td  align="left" valign="middle"> <input type="text" name="message_subject" size="35" style='width: 300px;'>
          <td  align="left" valign="top">Your
          <td  align="left" valign="top"><textarea name="message" cols="30" rows="8" wrap="VIRTUAL" style='width: 300px;'></textarea>
          <td colspan=2 align=center valign=middle><input type="submit" value="Submit" name="submit">
if(isset($_POST['submit'])) {
$to = "";
$subject = "Contact from website";
$from = "";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$message_subject = $_POST['message_subject'];
$body = " From: $name_field\n E-Mail: $email_field\n Subject: $message_subject\n Message: $message";
echo "Data has been submitted successfully.";
mail($to, $subject, $body);
} else {
echo "Sending failed, please check all fields";

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sar1973Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.