HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
Core PHPHTML

How to Create a mail System in PHP using HTML form

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.

contact.php

<html>
<head>
<title>Contact US</title>
</head>
<body>
<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"/>
</form>
</body>
</html>

mail.php

<?php
$text = "<span style='color:red;'>Error! Please try again.</span>";
if(isset($_POST['submit']))
{
	$name=$_POST['name'];
	$email=$_POST['email'];
	$phn=$_POST['mobile'];
	$message=$_POST['message'];

	
	$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"; 
	 
	if(@mail($to,$subject,$message,$headers))
	{
 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

contact page in php html form code mail system in php php form php validator
How to Get Current Indian Standard Time using PHPPrevHow to Get Current Indian Standard Time using PHPMarch 17, 2020
How to make a Logout system using PHP and MysqlMarch 17, 2020How to make a Logout system using PHP and MysqlNext

Related Posts

HTMLjQuery

How to Create Get Content and Attributes in jQuery

In this article, you will learn How to Create Get Content and Attributes in jQuery....

Rahul Kumar March 17, 2020
Core PHPMysql

How to Fetch Data From Mysql Database using PHP

How to Fetch Data From Mysql Database using PHP, from inserted data in Mysql database....

Rahul Kumar March 17, 2020
Search
Recent Posts
  • The Power of AI Writing Tools in Transforming Digital Marketing Strategies
  • What is the difference between web design and GUI design?
  • Transforming Your Business with JustEat Like App Excellence
  • The Role of Plagiarism Changers in Enhancing Content Quality
  • How Students Can Increase Their Academic Productivity With Paraphrase Tool?
Categories
  • Business
  • Core PHP
  • CSS
  • Digital Marketing
  • HTML
  • JAVA
  • Jobs
  • jQuery
  • Mysql
  • News
  • Others
  • Photography
  • Projects
  • Recipes
  • WordPress

  • How to Create List in HTML
  • How to use Iframe in HTML
  • How to Create a Table in HTML and CSS
  • How to Add New HTML Content using jQuery
  • CSS Property of List tag in HTML
  • How to use CSS for Table in HTML
  • How to Make Basmati Rice Recipe
  • How to Make Indian Kheer Recipe
  • How to Make Spicy Aloo Tikki
  • How to Make Aloo Matar Samosa
  • How to Make Cheese Potato Sandwich
  • How to Make Aloo Palak Methi
  • Company Visitors Management System
  • Complaint Management System using PHP
  • Directory Management System
  • Employee Record Management System
  • Hospital Management System using PHP
  • Vehicle Parking Management System

Copyright © 2022 Hub of Tutorials. All Rights Reserved. Designed by AS Webworks