HEX
Server: Apache
System: Linux s18.infinitysrv.com 3.10.0-962.3.2.lve1.5.87.el7.x86_64 #1 SMP Tue Jan 28 09:38:56 UTC 2025 x86_64
User: clavospa (1286)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/clavospa/public_html/new.davidlachapelleamor.com/models/sendMail.php
<?php

include_once dirname(__FILE__, 2) . '/models/phpMailer/autoload.php';

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

class sendMail {

    private $email = null;
    private $html = null;


    public function __construct(){}

    public function enviaMail($email, $html, $subject){

        $this ->email = $email;
        $this ->html = $html;

        $mail = new PHPMailer(true);

        try {

            $mail->isSMTP();                                            //Send using SMTP
            $mail->Host       = 'mail.davidlachapelleamor.com';                     //Set the SMTP server to send through
            $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
            $mail->Username   = 'no-reply@davidlachapelleamor.com';                     //SMTP username
            $mail->Password   = 'gdNZ3_0crnzZ';                               //SMTP password
            $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;         //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
            $mail->Port       = 465;                                    //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
            $mail->CharSet = 'UTF-8';
            
            //Recipients
            
            $mail->setFrom('no-reply@davidlachapelleamor.com', 'Davidlachapelleamor');
            $mail->addAddress($this ->email, 'Davidlachapelleamor');     //Add a recipient
            
            $mail->isHTML(true);                                  //Set email format to HTML
            $mail->Subject = $subject;
            $mail->Body    = $this ->html;

            $mail->send();
            
        } catch (Exception $e) {
            error_log($this ->email . "\t" . $mail->ErrorInfo . "\n", 3, DIR_ROOT.'/logs/'.date("Y-m-d")."_errorSendMail.txt");
        }





    }
}