File: //var/www/wintergenomics_site/xor/sendmail_data.php
<?php
require_once("general_conn.php");
require_once("moodle_conn.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\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'PHPMailer-master/vendor/autoload.php';
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //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 = 'noreply@wintergenomics.com'; //SMTP username
$mail->Password = 'voczclqfobumzqmp'; //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('noreply@wintergenomics.com', 'Winter Genomics');
$mail->addAddress('cursos@wintergenomics.com'); //Name is optional
$mail->addReplyTo('cursos@wintergenomics.com', 'Winter Genomics');
$mail->addBCC('redes@xorverel.com');
//Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
// $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Alumno: '.$_REQUEST[user_name]." ".$_REQUEST[user_last];
$mail->Body = '
Usuario: '.$_REQUEST[user_username].' <br>
Contraseña: '.$_REQUEST[user_password].' <br>
Nombre: '.$_REQUEST[user_name].' <br>
Apellido: '.$_REQUEST[user_last].' <br>
Correo: '.$_REQUEST[user_email].' <br>
Institución: '.$_REQUEST[university].' <br>
Profesión: '.$_REQUEST[level].' <br>
Origen: '.$_REQUEST[source].' <br>';
$mail->AltBody = ' Usuario: '.$_REQUEST[user_username].' ,
Clave: '.$_REQUEST[user_password].' ,
Nombre: '.$_REQUEST[user_name].' ,
Apellido: '.$_REQUEST[user_last].' ,
Correo: '.$_REQUEST[user_email].' ,
Ins: '.$_REQUEST[university].' ,
Prof: '.$_REQUEST[level].' ,
Origen: '.$_REQUEST[source].' .';
$mail->send();
// echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}