Hi Friends,
I have used this mail function it works properly. mail has sent when i submit the enquiry form. i need the "Enquiry posted sucessfully" message will be displayed in enquiry form. please tell the solution for my problem.
usermail.php
<?php
if( isset($_POST['name']) && isset($_POST['companyname']) && isset($_POST['address'])&& isset($_POST['country'])&&
isset($_POST['email'])&& isset($_POST['phone']) &&
isset($_POST['enquiry'])&& isset($_POST['details'])
){
$msg = "<b>Name</b> : ". $_POST['name'] . "<br><b>Company Name</b> : " . $_POST['companyname'] . "<br><b>Address</b> : " . $_POST['address']."<br><b>Country</b>:".$_POST['country']."<br><b>Email</b>:".$_POST['email']."<br><b>Phone</b>:".$_POST['phone']."<br><b>Enquiry for</b>:".$_POST['enquiry']."<br><b>Details</b>:".$_POST['details'];
$mailSent = sendMail("sundar_a1984@yahoo.com",$_POST['name'],$_POST['email'],$msg,"Enquiry Details");
}
function sendMail($to, $fromname, $fromemail, $msg, $subject){
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$fromname." <".$fromemail.">\r\n";
$msg = stripslashes($msg);
if ( mail($to,$subject,$msg,$headers) )
return 1;
else
return 0;
echo "<script language='javascript'>";
echo "window.alert('Thank You! Your Enquiry has posted successfuly.')";
echo "</script>";
}
?>
<?php
echo header('Location:enquiry.php');
?>