<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require __DIR__ . '/PHPMailer-master/src/Exception.php';
require __DIR__ . '/PHPMailer-master/src/PHPMailer.php';
require __DIR__ . '/PHPMailer-master/src/SMTP.php';

function nuevoMailer() {
    $mail = new PHPMailer(true);
    $mail->isSMTP();
    $mail->Host       = 'mail.misarriendos.cl';
    $mail->SMTPAuth   = true;
    $mail->Username   = 'notificaciones@misarriendos.cl';
    $mail->Password   = 'Mihogar182'; // 🔴 reemplaza
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
    $mail->Port       = 587;

    $mail->CharSet = 'UTF-8';
    $mail->setFrom('notificaciones@misarriendos.cl', 'Sistema de Arriendos');
    $mail->isHTML(true);

    return $mail;
}
