On any website have a contact page. The contact page has a form to fill and mail will deliver to the administrator. so in this article, you will learn How to Create a mail System in PHP using HTML form.


<title>Contact US</title>
<form method="POST" action="mail.php">
<input type="text" name="name" placeholder="Enter Your Name " required />
<input type="text" name="mobile" placeholder=" Enter Your Mobile Number" required />
<input type="text" name="email" placeholder="Enter Your Email " required />
<textarea name="message"></textarea>
<input type="submit" name="submit" value="Send"/>


$text = "<span style='color:red;'>Error! Please try again.</span>";

	$to = "info@mail.com";
	$subject = "Contact";
	$message = " Name: " . $name ."\r\n Email: " . $email . "\r\n mobile: " . $phn . "\r\n Message:\r\n" . $message;
	$from = "Contact";
	$headers = "From:" . $email. "\r\n";
	$headers .= "Content-type: text/plain; charset=UTF-8" . "\r\n"; 
 echo "<script> window.location.href='contact.php;  alert('Send Successfully');</script>";
	  $text = "<span style='color:blue;'>Your Message was sent successfully !</span>";

How to Make Fees Receipt in PHP Using Mysql Database

Read on Facebook