<?php
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$comments=$_POST['comments'];
$to="devika@cetpainfotech.com";
$headers="From:$name<$email>";
$message="Name:$name\n\n Email:$email\n\n Subject:$subject\n\n ";
if (mail($to,$subject,$message,$headers))
{
echo"Mail sent";
}
else
{
echo "Error: Try again later";
}
}
?>
<!DOCTYPE HTML>
<html lang ="en-US">
<head>
<meta charset ="UTF-8">
<title>devika</title>
</head>
<body>
<form action="" method="post">
<p>Name<br/>
<input type="text" name ="name" id="" ></p>
<p>Email<br/>
<input type="text" name ="email" id="" ></p>
<p>Subject<br/>
<input type="text" name ="subject" id="" ></p>
<p>Comments<br/>
<textarea type="text" name ="comments" id="" cols="30" rows="10"></textarea></p>
<p>
<input type="submit" name ="submit" id="" value="Send Email"></p>
</form>
</body>
</html>
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$comments=$_POST['comments'];
$to="devika@cetpainfotech.com";
$headers="From:$name<$email>";
$message="Name:$name\n\n Email:$email\n\n Subject:$subject\n\n ";
if (mail($to,$subject,$message,$headers))
{
echo"Mail sent";
}
else
{
echo "Error: Try again later";
}
}
?>
<!DOCTYPE HTML>
<html lang ="en-US">
<head>
<meta charset ="UTF-8">
<title>devika</title>
</head>
<body>
<form action="" method="post">
<p>Name<br/>
<input type="text" name ="name" id="" ></p>
<p>Email<br/>
<input type="text" name ="email" id="" ></p>
<p>Subject<br/>
<input type="text" name ="subject" id="" ></p>
<p>Comments<br/>
<textarea type="text" name ="comments" id="" cols="30" rows="10"></textarea></p>
<p>
<input type="submit" name ="submit" id="" value="Send Email"></p>
</form>
</body>
</html>