| Server IP : 52.9.100.119 / Your IP : 216.73.216.226 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/qmg/circulo/vendor/ |
Upload File : |
<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load composer's autoloader
require 'autoload.php';
$data = json_decode(file_get_contents("php://input"));
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
// $mail->SMTPDebug = 2; // Enable verbose debug output
// $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 = 'mlizarraga@quattromg.com'; // SMTP username
// $mail->Password = 'aPOjxRLE3Tkh2nZb'; // SMTP password
// $mail->SMTPSecure = 'TLS'; // Enable TLS encryption, `ssl` also accepted
// $mail->Port = 587; // TCP port to connect to
// $mail->CharSet = "UTF-8";
$mail->isSMTP(); // Set mailer to use $
$mail->Host = 'smtp.sendgrid.net'; // Specify main and $
$mail->SMTPAuth = true; // Enable SMTP authen$
$mail->Username = 'apikey'; // SMTP username
$mail->Password = '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';
// $mail->SMTPSecure = 'ssl'; // Enable TLS encr$
$mail->Port = 587; // TCP port to connec$
$mail->CharSet = "UTF-8";
//Recipients
$mail->setFrom('mensajes@quattromg.com', 'Circulo Pablo Sanchez');
$mail->addAddress('edgarjsolorio@gmail.com'); // Add a recipient
$mail->addAddress('maaritza-@hotmail.com');
// $mail->addAddress('dleon@energiasalternas.com ');
//Content
$name = $data->nombre;
$phone = $data->whatsapp;
$email= $data->email;
$company = $data->empresa;
$mail->isHTML(true);
$mail->Subject = 'Mensaje de contacto Circulo Pablo Sanchez';
$mail->Body = '<b>Nombre: </b><br>';
$mail->Body .= $name;
$mail->Body .= '<br><br><b>Correo:</b><br>';
$mail->Body .= $email;
$mail->Body .= '<br><br><b>Teléfono:</b><br>';
$mail->Body .= $phone;
$mail->Body .= '<br><br><b>Empresa:</b><br>';
$mail->Body .= $company;
if(!$mail->send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo 200;
}
} catch (Exception $e) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
}