Email Form Using PHP

By | September 12, 2012

Many websites are having contact with mail function implemented. when we send them a message, then message will automatically. But in some of the website, when we send them a message it will be added to their admin panel and no email will be sent.

Here i am using mailto() php function to send mail.

Note:

  • Use this below code in your web server, when use this code in your localhost it won’t work. If you want to make work this code in your localhost, then you have to config SMTP in your localhost.

[code type=php]
<?php
if(isset($_POST[‘submit’]))
{
$name=$_POST[‘name’];
$contact=$_POST[‘contact’];
$msg=$_POST[‘msg’];
$msg1=”Name: $name <br/> Contact : $contact <br /> Message: $msg”;
mailto(‘YOUR MAIL ID’,’Contact Form’,’$msg1′);
}
?>
<form action=”” method=”post”>
Name: <input type=”text” name=”name”>
Contact Number: <input type=”text” name=”contact”>
Your Message<textarea name=”msg”></textarea>
</form>
[/code]

2 thoughts on “Email Form Using PHP

  1. walter

    thank you thank you so much for these codes they are really helpful, can you please send me codes for a salon booking system where users will book online

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

colleagueship-lexeme