🌹🏠🌹？》《》？《》？<?php 
require_once('Connections/gargano.php'); 
include_once('PHPMailer/PHPMailer-master/class.phpmailer.php');
include_once('PHPMailer/PHPMailer-master/class.smtp.php');


$userIP = $_SERVER["REMOTE_ADDR"];
$recaptchaResponse = $_REQUEST['recaptchaResponse'];
$secretKey = "6Ld0kHMcAAAAAMvqJ6InWJw0Phn2Of39NnLnWya-";
$request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secretKey}&response={$recaptchaResponse}&remoteip={$userIP}");
if(strstr($request, "true")){		

if ((isset($_POST["nombre"])) && ($_POST["nombre"] != "")) {
  $insertSQL = sprintf("INSERT INTO contacto (fecha, nombre, email, empresa, telefono, mensaje) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString(date('Y-m-d'), "date"),
                       GetSQLValueString($_POST['nombre'], "text"),
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['empresa'], "text"),
                       GetSQLValueString($_POST['telefono'], "text"),
                       GetSQLValueString($_POST['mensaje'], "text"));
  $Result1 = mysqli_query($gargano,$insertSQL) or die(mysqli_error());
  
  
  
$html='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t�tulo</title>
</head>

<body>
<table width="100%" border="0">
  <tr>
    <td width="20%">Nombre y apellido</td>
    <td width="80%">'.escape($_POST['nombre']).'</td>
  </tr>
  <tr>
    <td>Email</td>
    <td>'.escape($_POST['email']).'</td>
  </tr>
  
  <tr>
    <td>Empresa</td>
    <td>'.escape($_POST['empresa']).'</td>
  </tr>

  <tr>
    <td>Telefono</td>
    <td>'.escape($_POST['telefono']).'</td>
  </tr>
  <tr>
    <td>Consulta</td>
    <td>'.escape($_POST['mensaje']).'</td>
  </tr>
</table>

</body>
</html>
';	

  $mail = new PHPMailer(true);
  $mail->IsHTML(true);
  $mail->CharSet = 'UTF-8';
  $mail->IsSMTP(); 
  $mail->SMTPAuth   = true;       // enable SMTP authentication
  $mail->From = 'gargano_mailer@gargano.com.ar';
  $mail->FromName = "Gargano Mailer";
  $mail->Subject = "e-commerce – CONTACTO ";
  $mail->Body = $html;
  $mail->AddAddress("ecommerce@gargano.com.ar");

  if(!$mail->Send()) {
    $mail->ErrorInfo;
    $error = true;                                                        
  }

  header("Location: gracias.php");
} else { 

	echo 'Hubo un error en el envio del mail, Intente mas tarde por favor !! ';
}
}
?>