This is my sample code for auto response email in php. When i try to send, the auto response they receiving is not the output. Rather, they are receiving the HTML code.
<?php
$to = 'test@gmail.com';
$subject = 'persona details';
$name = $_POST['name'];
$email = $_POST['email'];
$message = "
Customer Name: $name <br/>
Email Id: $email
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "
";
$headers .= "Content-type:text/html;charset=UTF-8" . "
";
$headers .= "From:" . $email . "
";
// Auto response code
$headers2 = "MIME-Version: 1.0" . "
";
$headers2 .= "Content-type:text/html;charset=UTF-8" . "
";
$headers2 = "From:" . $to."
";
$body=<<<EMAIL
<html>
<head>
<title>HTML email</title>
</head>
<body>
<h1>Sudhakar</h1>
<p><img src='http://garciniainfotech.com/images/garcinia.jpg'> </p>
</body>
</html>
EMAIL;
mail($to,$subject,$message,$headers);
mail($email,$subject,$body,$headers2);
?>