Hi everyone, i have request form in my site. i submit the form in php the mail send to server.i need a code the mail send to server and "thank you for request" mail send to client at a time .
Example:
<?php
ob_start();
$namecp = $_POST['namecp'];
$namec = $_POST['namec'];
$mobile = $_POST['mobile'];
$lname = $_POST['lname'];
$problem = $_POST['problem'];
$Failure_date = $_POST['Failure_date'];
$Failure_Hours = $_POST['Failure_Hours'];
$Failure_Minutes = $_POST['Failure_Minutes'];
$Failure_sec = $_POST['Failure_sec'];
$Service_required_date = $_POST['Service_required_date'];
$Service_Hours = $_POST['Service_Hours'];
$Service_Minutes = $_POST['Service_Minutes'];
$Service_sec = $_POST['Service_sec'];
$Door_No = $_POST['Door_No'];
$Area_Nagar = $_POST['Area_Nagar'];
$city = $_POST['city'];
$state_district = $_POST['state_district'];
$Postal_Code = $_POST['Postal_Code'];
$Engine_Serial_number = $_POST['Engine_Serial_number'];
$Contact_phone_number= $_POST['Contact_phone_number'];
$Contact_phone_number_full= $_POST['Contact_phone_number_full'];
$cemail= $_POST['cemail'];
$ps= ':';
$ps1= '/';
$ps2= '-';
$pno= '+91 ';
function sendHTMLemail($HTML,$from,$to,$subject)
{
// First we have to build our email headers
// Set out "from" address
$headers = "From: $from\r\n";
// Now we specify our MIME version
$headers .= "MIME-Version: 1.0\r\n";
// Create a boundary so we know where to look for
// the start of the data
$boundary = uniqid("HTMLEMAIL");
// First we be nice and send a non-html version of our email
$headers .= "Content-Type: multipart/alternative;".
"boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n".
"Content-Type: text/plain; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode(strip_tags($HTML)));
// Now we attach the HTML version
$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($HTML));
// And then send the email ....
mail($to,$subject,"",$headers);
}
// Connect to server and select database.
// values sent from form
$email='[email protected]';
// ---------------- SEND MAIL FORM ----------------
$header1 = 'Service Request';
// send e-mail to ...
$to=$email;
// Your subject
$subject="service request";
// From
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "SPC";
$message = "<table width='500' border='0' cellspacing='0' cellpadding='0'>";
$message .= "<tr><td>Name of the contact person</td><td>:</td><td>".$namecp."</td></tr>";
$message .= "<tr><td>Name of the Customer</td><td>:</td><td>".$namec."</td></tr>";
$message .= "<tr><td>Mobile number</td><td>:</td><td>".$pno.$mobile."</td></tr>";
$message .= "<tr><td>Problem summary</td><td>:</td><td>".$problem."</td></tr>";
$message .= "<tr><td>Failure date & time</td><td>:</td><td>".$Failure_date.$ps1.$Failure_Hours.$ps.$Failure_Minutes.$ps.$Failure_sec."</td></tr>";
$message .= "<tr><td>Service required date & time</td><td>:</td><td>".$Service_required_date.$ps1.$Service_Hours.$ps.$Service_Minutes.$ps.$Service_sec."</td></tr>";
$message .= "<tr><td>Door No. & Street Name</td><td>:</td><td>".$Door_No."</td></tr>";
$message .= "<tr><td>Area/Nagar</td><td>:</td><td>".$Area_Nagar."</td></tr>";
$message .= "<tr><td>City</td><td>:</td><td>".$city."</td></tr>";
$message .= "<tr><td>State/District</td><td>:</td><td>".$state_district."</td></tr>";
$message .= "<tr><td>Postal Code/Zip Code</td><td>:</td><td>".$Postal_Code."</td></tr>";
$message .= "<tr><td>Engine Serial number</td><td>:</td><td>".$Engine_Serial_number."</td>
</tr>";
$message .= "<tr><td>Phone number</td><td>:</td><td>".$Contact_phone_number.$ps2.$Contact_phone_number_full."</td></tr>";
$message .= "<tr><td>Email</td><td>:</td><td>".$cemail."</td></tr>";
$message .= "</table>";
//echo $message;
// send email
sendHTMLemail($message,$header1,$to,$subject);
//header('Location: ');
ob_end_flush();
?>