Your IP : 216.73.216.65


Current Path : /home/a/t/a/ataenra/www/ATA/INTRANET/GenPDF/1Simulation/
Upload File :
Current File : /home/a/t/a/ataenra/www/ATA/INTRANET/GenPDF/1Simulation/mailSimulation.php

<?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;

require '../../Outils/phpmailer/src/Exception.php';
require '../../Outils/phpmailer/src/PHPMailer.php';
require '../../Outils/phpmailer/src/SMTP.php';

//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);

try {
  
    //IDENTIFIANTS SERVEUR
    require "../../Outils/CoMail.php";

    //DESTINATAIRES
    $mail->setFrom('ata.enr@gmail.com', 'ATA ENR');
    $mail->addAddress(''.$Info->email.'', ''.$Info->nom.' '.$Info->prenom. '');             
    $mail->addReplyTo('ata.enr@gmail.com', 'Information');
    //$mail->addCC(''.$_SESSION['EMAILCOM'].'');
    
    //PIECES JOINTES DU MAIL
    //Si pac Seule Air/Eau ou Hybride
    $mail->addAttachment('../../../FICHIERS/'.$ID.'/Simulation/Simulation'.$ID.'.pdf');

    //CONTENU DU MAIL
    $mail->isHTML(true);                                
    $mail->Subject = 'Votre Simulation Numero : '.$ID.'';
    $mail->Body    = 'Vous trouverez en piece jointe votre simulation réalisée avec '.$Info->user.' numéro : <b>'.$ID.'</b>';
  
    //ENVOYER MAIL
    $mail->send();
    
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

?>