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

require '../vendor/PHPMailer/PHPMailer.php';
require '../vendor/PHPMailer/SMTP.php';
require '../vendor/PHPMailer/Exception.php';

$mail = new PHPMailer(true);

try {
    $mail->isSMTP();
    $mail->Host = 'smtp.gmail.com'; // o tu servidor
    $mail->SMTPAuth = true;
    $mail->Username = 'tucorreo@gmail.com';
    $mail->Password = 'tu_clave';
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;

    $mail->setFrom('tucorreo@gmail.com', 'ALMACENCRM');
    $mail->addAddress('otrocorreo@ejemplo.com');

    $mail->isHTML(true);
    $mail->Subject = 'Correo de prueba';
    $mail->Body = 'PHPMailer funciona correctamente 🎉';

    $mail->send();
    echo 'Correo enviado exitosamente';
} catch (Exception $e) {
    echo "Error: {$mail->ErrorInfo}";
}
