%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/3183/cwd/canadasdelmirador.com/
Upload File :
Create Path :
Current File : //proc/3183/cwd/canadasdelmirador.com/mensaje.php

    <HTML>
<HEAD>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="text/javascript" src="js/jquery.js"></script>
    <link rel="stylesheet" type="text/css" href="css/styles.css">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
</HEAD>
<BODY>
<?php
// Incluir PHPMailer (ajusta la ruta)
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
// Ingresa tu clave secreta.....
define("RECAPTCHA_V3_SECRET_KEY", '6LdET14gAAAAAETjZmICFqmmVRYTzAJG1Bf9KJ5r');
$token = $_POST['token'];
$action = $_POST['action'];
 
// call curl to POST request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.google.com/recaptcha/api/siteverify");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('secret' => RECAPTCHA_V3_SECRET_KEY, 'response' => $token)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$arrResponse = json_decode($response, true);
 
// verificar la respuesta
if($arrResponse["success"] == '1' && $arrResponse["action"] == $action && $arrResponse["score"] >= 0.4) {
    // Si entra aqui, es un humano, puedes procesar el formulario
    $Nombre = $_POST["nombre"];
    $Email = $_POST["email"];
    $Telefono = $_POST["telefono"];
    $Mensaje = $_POST["mensaje"];
    $MEDIO = "";   
   // $fecha = $_POST["fecha"];

    if (isset($_POST["INFORMACION"])){
        $MEDIO = $_POST["INFORMACION"];
    }

    require('class_ith.php');
    list($vrNombre,$vrApellido)=fnformatnombre($Nombre);
    $comentario="$Mensaje. (Medio: $MEDIO)";

    $vrFecha = date("Y-m-d H:i:s");
    if (!empty($_POST["fecha"])){
        $date = date_create ($_POST["fecha"]);
        $fecha= date_format($date,"d/m/Y");
        $hora = $_POST["hora"].":00";
        $comentario.="||CITA: $fecha|HORA: $hora";
    }
    
    $data = array(
    'type' => "fnLeadWP",
    'name' => $Nombre,
    'celular' => $Telefono,
    'email' => $Email,
    'access' => 10,
    'project' => 3,
    'company' =>2,
    'comentario' =>$comentario
    );

    $ch = curl_init("https://bsys.mx/siga_ventas/ws_leads_ventas/");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    $result = curl_exec($ch); // Submit the POST request
    curl_close($ch); // Close cURL session handle

    $respuesta=json_decode($result,true);




  // Envío del correo usando PHPMailer
    $mail = new PHPMailer(true);
    
    try {
        //Configuración del servidor SMTP
        $mail->isSMTP();
        $mail->Host = 'smtp.gmail.com';  // Servidor SMTP
        $mail->SMTPAuth = true;
        $mail->Username = 'helpbinfo@gmail.com'; // Tu correo de Gmail
        $mail->Password = 'wovrqesluirppipu';       // Contraseña de Gmail
        $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
        $mail->Port = 587;

        // Destinatarios
        $mail->setFrom('helpbinfo@gmail.com', 'Canadas del Mirador');
        $mail->addAddress('gdq.canadasbyem@in.parseur.com', 'Nombre del destinatario');

        // Contenido del correo
        $mail->isHTML(true);
        $mail->Subject = 'Mensaje de '.$Nombre;
        $mail->Body = $Nombre.':<br><br>'.$Mensaje.'<br><hr>Correo: '.$Email.'<br>Cel: '.$Telefono.'<br><br>Solicito: '.$MEDIO;

        $mail->send();
        echo 'El mensaje se envió correctamente.';
    } catch (Exception $e) {
        echo "Hubo un error al enviar el mensaje. Mailer Error: {$mail->ErrorInfo}";
    }

    /*

        $iCl = new inf_ith(true);
        if($iCl->connect_errno == 0){
            
            $vrLead = " INSERT INTO tb_leads(nombre,apellidos, telefono, correo, medioID, empresaID, proyectoID, fechaRegistro, fechaMod,estatus, comentario) VALUES ('".$vrNombre."','".$vrApellido."','".$Telefono."','".$Email."',10,2,2,now(),now(),'Nuevo','$comentario');";

            $iCl->scr =$vrLead;
            $res = $iCl->qry('{"funcion": "consulta"}');
            $vrBnd = false;
            if($res->numero == 5){
               $vrBnd=true;
            }
       
        }
        $iCl->qrc();
        
        //KJHLKJHKJHLH Inserto miriam 290121 
*/


  //  $Mensaje2 = $Nombre.':<br><br>'.$Mensaje.'<br><hr>Correo: '.$Email.'<br>Cel: '.$Telefono.'<br><br>Solicitó:'.$MEDIO.'<br><br>Fecha: '.$vrFecha;

    //$cabeceras = 'MIME-Version: 1.0' . "\r\n";
   // $cabeceras .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    //$cabeceras .= 'From: Cañadas by El Mirador<ventas@canadasdelmirador.com.mx>';


   // $enviado = mail("bsy.drt.ventas@gmail.com","Mensaje de ".$Nombre,$Mensaje2,$cabeceras);
    //$enviado = mail("erickl8a.elo@gmail.com","Mensaje de ".$Nombre,$Mensaje2,$cabeceras);
        //  echo "ok!, eres un humano";
    } else {
        // Si entra aqui, es un robot....
      echo "Lo siento, parece que eres un Robot y no se pudieron enviar tus datos";
    }
    ?>
</BODY>

Zerion Mini Shell 1.0