| 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/epi/ |
Upload File : |
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//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\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'vendor/autoload.php';
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json,application/x-www-form-urlencoded,multipart/form-data');
header('Access-Control-Allow-Headers: Content-Type');
$nombre = $_POST["nombre"].' '.$_POST["apellido1"].' '.$_POST["apellido2"];
$nacimiento = $_POST["nacimiento"];
$telefono = $_POST["telefono"];
$correo = $_POST["mail"];
$vacante = $_POST["vacante"];
$cv_adjunto = isset($_FILES['cv_adjunto']) ? $_FILES['cv_adjunto'] : NULL;
if (!empty($cv_adjunto)){
$extension = pathinfo($cv_adjunto['name'], PATHINFO_EXTENSION);
$ruta_destino_archivo = "/data/html/epi/".$cv_adjunto['name'];
$origin = "Ruta y nombre del archivo: ".$cv_adjunto['tmp_name'];
$save = "Ruta y nombre del destino: ".$ruta_destino_archivo;
$archivo_ok = move_uploaded_file($cv_adjunto['tmp_name'], $ruta_destino_archivo);
}
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = false; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'epi.empleos@gmail.com'; //SMTP username
$mail->Password = 'akbyjnjwflsibagv'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom('epi@epimexico.com', 'EPI Mexico');
$mail->addAddress('rodrigo@epimexico.com', 'EPI Mexico website'); //Add a recipient
//Attachments
//$mail->addAttachment($ruta_destino_archivo); //Add attachments
if (!empty($cv_adjunto)){
//Attachments
$mail->addAttachment($ruta_destino_archivo); //Add attachments
}
//Content
$subject = "Nueva Aplicacion de empleo";
$subject = utf8_decode($subject);//Set email format to HTML
$mail->Subject = $subject;
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = '';
$mail->Body = '<h2>Vacante : </h2> <h2>'.$vacante.'</h2> <br><br>'.'<h2>nombre : </h2> <h2>'.$nombre.'</h2> <br>'.'<h2>Fecha de nacimiento : </h2> <h2>'.$nacimiento.'</h2> <br>'.'<h2>telefono : </h2> <h2>'.$telefono.'</h2> <br>'.'<h2>correo : </h2> <h2>'.$correo.'</h2>';
$mail->send();
header("Location: https://www.epimexico.com/empleos-send.html");
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}