<?php session_start();
date_default_timezone_set('Asia/Calcutta');
if (isset($_POST['submit'])): 
        $to = 'gokul@poojainfotech.in';
        $from = $_POST['name'] . ' info@poojainfotech.com';
        $sub = 'Enquiry Details From Erardoindia';
        $headers = "From: $from\r\n" .
            "Cc: $cc \r\n" .
            'X-Mailer: PHP/' . phpversion() . "\r\n" .
            "MIME-Version: 1.0\r\n" .
            "Content-Type: text/html; charset=utf-8\r\n" .
            "Content-Transfer-Encoding: 8bit\r\n\r\n";
        $mess = "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Enquiry Details</title></head><body>
		<table width='1000' border='0' align='center' cellspacing=2 cellpadding='5' bordercolor='#1D2E7E' bgcolor='#1D2E7E'>
		<tr><td colspan='2' bgcolor='#1D2E7E' style='color:#FFFFFF'><strong>Erardoindia Product Enquiry</strong></td></tr>
		<tr><td width='200' bgcolor='#FFFFFF'><strong>Name</strong></td><td width='500' bgcolor='#FFFFFF'>$_POST[name]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Product</strong></td><td bgcolor='#FFFFFF'>$_POST[subject]</td></tr>
 	    <tr><td bgcolor='#FFFFFF'><strong>Mobile</strong></td><td bgcolor='#FFFFFF'>$_POST[phone]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Email</strong></td><td bgcolor='#FFFFFF'>$_POST[email]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Location</strong></td><td bgcolor='#FFFFFF'>$_POST[location]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Message</strong></td><td bgcolor='#FFFFFF'>$_POST[comments]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Date</strong></td><td bgcolor='#FFFFFF'>" . date("F j, Y, g:i:s a") . "</td></tr></table></body></html>";
        $er = mail($to, $sub, $mess, $headers);
        $to = $_POST['email'];
        $from = 'info@poojainfotech.com';
        $sub = 'Enquiry Details From Erardoindia';
        $headers = "From: $from\r\n" .
            'X-Mailer: PHP/' . phpversion() . "\r\n" .
            "MIME-Version: 1.0\r\n" .
            "Content-Type: text/html; charset=utf-8\r\n" .
            "Content-Transfer-Encoding: 8bit\r\n\r\n";
        $mess = "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Enquiry Details</title></head><body>
		<table width='1000' border='0' align='center' cellspacing=2 cellpadding='5' bordercolor='#1D2E7E' bgcolor='#1D2E7E'>
		<tr><td colspan='2' bgcolor='#1D2E7E' style='color:#FFFFFF'><strong>YOUR DETAILS SUBMITTED AT POOJAINFOTECH</strong></td></tr>
		<tr><td width='200' bgcolor='#FFFFFF'><strong>Name</strong></td><td width='500' bgcolor='#FFFFFF'>$_POST[name]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Product</strong></td><td bgcolor='#FFFFFF'>$_POST[subject]</td></tr>
 	    <tr><td bgcolor='#FFFFFF'><strong>Mobile</strong></td><td bgcolor='#FFFFFF'>$_POST[phone]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Email</strong></td><td bgcolor='#FFFFFF'>$_POST[email]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Location</strong></td><td bgcolor='#FFFFFF'>$_POST[location]</td></tr>
		<tr><td bgcolor='#FFFFFF'><strong>Message</strong></td><td bgcolor='#FFFFFF'>$_POST[comments]</td></tr>
		</table></body></html>";
        if (mail($to, $sub, $mess, $headers)):
            echo "<script>alert('Thank you for Enquiry. We will contact you shortly..'); </script>";
            echo '<script type="text/javascript">location.href="https://erardoindia.com/"</script>;';
        endif;
        endif; ?>
