| Server IP : 52.9.100.119 / Your IP : 216.73.216.135 Web Server : Apache/2.4.61 (Amazon) OpenSSL/1.0.2k-fips PHP/7.3.30 Phusion_Passenger/5.1.5 System : Linux ip-172-31-9-35 4.14.355-196.618.amzn1.x86_64 #1 SMP Mon Apr 7 17:09:50 UTC 2025 x86_64 User : root ( 0) PHP Version : 7.3.30 Disable Function : exec,passthru,shell_exec,system,popen,proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /data/html/virtualThink/ |
Upload File : |
<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
require 'vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//use Google\Cloud\RecaptchaEnterprise\V1\RecaptchaEnterpriseServiceClient;
//use Google\Cloud\RecaptchaEnterprise\V1\Event;
//use Google\Cloud\RecaptchaEnterprise\V1\Assessment;
/* Commenting out the reCAPTCHA function
function create_assessment(
string $projectNumber,
string $recaptchaToken
) {
$client = new RecaptchaEnterpriseServiceClient();
$formattedParent = $client->projectName($projectNumber);
$event = new Event();
$event->setToken($recaptchaToken);
$assessment = new Assessment();
$assessment->setEvent($event);
$response = $client->createAssessment($formattedParent, $assessment);
$tokenProperties = $response->getTokenProperties();
if ($tokenProperties->getValid() && $response->getRiskAnalysis()->getScore() > 0.5) {
// reCAPTCHA token is valid
echo 'reCAPTCHA verification passed.';
return true;
} else {
// reCAPTCHA token is invalid
echo 'reCAPTCHA verification failed.';
return false;
}
}
*/
//Load composer's autoloader
$data = json_decode(file_get_contents("php://input"));
if (!empty($data->honeypot)) {
echo "Honeypot field should be empty.";
return;
}
// Commenting out the reCAPTCHA token and project number variables
//$recaptchaToken = $data->recaptchaResponse ?? '';
//$projectNumber = 'spark-and-bloom-1710870640733';
// Commenting out the reCAPTCHA assessment call
/*
if (!create_assessment($projectNumber, $recaptchaToken)) {
echo 'reCAPTCHA verification failed.';
return; // Stop execution if CAPTCHA is invalid
} else {
*/
$mail = new PHPMailer(true);
// Specify your SSL options
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => false,
'cafile' => 'vendor/config/cacert.pem', // Specify the path to your CA certificates file
)
);
// Passing `true` enables exceptions
try {
//Server settings
// $mail->SMTPDebug = true; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.sendgrid.net'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'apikey'; // SMTP username
$mail->Password = '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'; // SMTP password
$mail->SMTPSecure = "tls"; //Enable implicit TLS encryption
$mail->Port = 587;
$mail->CharSet = "UTF-8";
//Content
$nombre = $data->nombre;
$telefono = $data->telefono;
$correo = $data->correo;
$dudas = $data->dudas;
$mail->setFrom('mensajes@quattromg.com', 'Correo Contacto Virtual Think');
$mail->addAddress('edgarjsolorio@gmail.com');
$mail->addAddress('solorio@quattro.marketing');
$mail->isHTML(true);
$mail->Subject = 'Correo de Sitio Web';
$mail->Body = '
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
color: #333;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 10px;
border: 1px solid #ddd;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<table>
<tr>
<th colspan="2">Información de Contacto</th>
</tr>
<tr>
<td><b>Nombre y Apellido:</b></td>
<td>' . htmlspecialchars($nombre, ENT_QUOTES, 'UTF-8') . '</td>
</tr>
<tr>
<td><b>Teléfono:</b></td>
<td>' . htmlspecialchars($telefono, ENT_QUOTES, 'UTF-8') . '</td>
</tr>
<tr>
<td><b>Correo:</b></td>
<td>' . htmlspecialchars($correo, ENT_QUOTES, 'UTF-8') . '</td>
</tr>
<tr>
<td><b>Dudas o Comentarios:</b></td>
<td>' . htmlspecialchars($dudas, ENT_QUOTES, 'UTF-8') . '</td>
</tr>
</table>
</body>
</html>';
$mail->send();
http_response_code(200);
echo 200;
} catch (Exception $e) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
//}
?>