<?php
// RECIBIR VALORES DEL POST

$name = $_POST['name'];
$lastname = $_POST['lastname'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];


/* recipiente */
$para = "info@globalcaribbeanco.com, tuliosuazo@gmail.com";

/* subject */
$subject = "Request sent from GLOBAL CARIBBEAN COMMODITIES Website";
/* contenido */
$mensaje = "
<center> <h1>CONTACT FORM</h1></center> 
<br><br>
<table width=\"600\" border=\"1\" align=\"center\" cellpadding=\"2\" cellspacing=\"2\" bordercolor=\"#000000\">
  <tr>
    <th align=\"left\" nowrap><span class=\"style8\">Name</span></th>
    <td align=\"left\" nowrap>$name</td>
  </tr>
    
	
	  <tr>
    <th align=\"left\" nowrap><span class=\"style8\">Last Name</span></th>
    <td align=\"left\" nowrap>$lastname</td>
  </tr>
	
	
		  <tr>
    <th align=\"left\" nowrap><span class=\"style8\">Phone</span></th>
    <td align=\"left\" nowrap>$phone</td>
  </tr>
	
  <tr>
    <th align=\"left\" nowrap scope=\"row\"><span class=\"style8\">e-mail</span></th>
    <td align=\"left\" nowrap>$email</td>
  </tr>
  
  <tr>
    <th align=\"left\" nowrap scope=\"row\"><span class=\"style8\">Commments</span></th>
    <td align=\"left\" nowrap>$comments</td>
  </tr>

</table>
";
/* Para enviar HTML en el mail */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* de donde viene el email  */
$headers .= "From: $name <$email>\r\n";

/* and now mail it */
if (!mail($para, $subject, $mensaje, $headers)){
 	echo "ERROR: CORREO NO ENVIADO";
}

?>
<html>
<head>
<title>Thanks for your request.</title>
<meta http-equiv="refresh" content="4;URL=index.php">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>

*{
	margin: 0; padding:0;
	}

.gracias {
	
	font-family:Arial, Helvetica, sans-serif;
	color:#01406D;
	font-size:60px;
}

.text {
	
	font-family:Arial, Helvetica, sans-serif;
	color:#01406D;
	font-size:40px;
}

.top {
	margin:0 auto;
	background-color:#EEE;
	height:90px;
	margin-bottom:20px;
	padding-top:20px;
	padding-bottom:20px;
	text-align:center;
}

</style>

</head>
<body>
<div class="top"><a href="index.php"><img src="images/logo.png" width="234" height="99" border="0"></a></div>
<div class="gracias" align="center">Thanks for your request,</div>
<div class="text" align="center">We will answer you as soon as possible.</div>
</body>
</html>