 <?php

 $name = $email_address = $phone = $messages = "";

 $remoteaddr = $_SERVER['REMOTE_ADDR'];

// Check for empty fields

 if ($_SERVER["REQUEST_METHOD"] == "POST") {

    $name = test_input($_POST["name"]);

    $email_address = test_input($_POST["email"]);

    $phone = test_input($_POST["phone"]);

    $messages = test_input($_POST["message"]);

}

function test_input($data) {

    $data = trim($data);

    $data = stripslashes($data);

    $data = htmlspecialchars($data);

    return $data;

}

$to = "nestrovindia@gmail.com, mediagindia@gmail.com";
// $to = "dalviswapnesh786@gmail.com";

$subject = "pride World City Enquiry";

$message = "<h1>pride World City Enquiry Details</h1>";

$message .= "You have received a new message from your website contact form. <br> Here are the details: <br> Project Name:  pride World City <br> Name:  $name <br> Email Id:  $email_address <br> Mobile No:  $phone <br> Message:\n $messages \n IP Address: $remoteaddr";

$header = "From: nestrovindia <nestrovindia@gmail.com>,  \r\n";

$header .= "Cc: mediagindia@gmail.com \r\n";

// $header .= "Cc: dalviswapnesh786@gmail.com \r\n";

$header .= "MIME-Version: 1.0\r\n";

$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$message,$header);

if( $retval == true ) {echo "success";}else {echo "Message could not be sent..."; }

?>