| Server IP : 52.9.100.119 / Your IP : 216.73.216.193 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/peakme/ |
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;
$data = json_decode(file_get_contents("php://input"));
if (!empty($data->honeypot)) {
echo "Honeypot field should be empty.";
return;
}
$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->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp-relay.brevo.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '9059ba001@smtp-brevo.com'; // SMTP username
$mail->Password = 'xsmtpsib-4b11514ec0d703822ccae9d31d3e38b24f5506a0a460ece991a02a3802644bf0-PEqr5nG2mhq67vDJ'; // SMTP password
$mail->Port = 587; // TCP port to connect to
$mail->CharSet = "UTF-8";
//Content
$nombre = $data->nombre;
$email = $data->email;
$telefono = $data->telefono;
$mensaje = $data->mensaje;
$mail->setFrom('contactoweb@quattromg.com', 'Correo Contacto Actor\'s Challenge');
$recipients = ['cursos@peakme.com.mx'];
foreach ($recipients as $email) {
$mail->addAddress($email);
}
$mail->isHTML(true);
$mail->Subject = 'Correo de Sitio Web Actor\'s Challenge';
$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>Email:</b></td>
<td>' . htmlspecialchars($email, 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>Mensaje:</b></td>
<td>' . htmlspecialchars($mensaje, 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;
}
//}
?>