<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$to = "genovapipe@gmail.com";
$to2 = "netsoftcomputeridn@gmail.com";
//$subject = "Pesan Baru dari Contact Us";
$subject = $_POST['subject'];
$body = "Nama: $name\nEmail: $email\nPesan: $message";

if (mail($to, $subject, $body)) {
  //echo "Pesan berhasil dikirim!";
  mail($to2, $subject, $body);
$message = "Pesan berhasil dikirim !";
echo "<script type='text/javascript'>alert('$message');</script>";
 $dynamic_url = "index.html";
        echo "<script>window.location.href = '" . $dynamic_url . "';</script>";

} else {
  echo "Gagal mengirim pesan.";
}
?>