<?php
require_once 'PHPMailer/src/PHPMailer.php';
require_once 'PHPMailer/src/SMTP.php';
require_once 'PHPMailer/src/Exception.php';

use PHPMailer\PHPMailer\PHPMailer;

$mail = new PHPMailer(true);

try {
    $mail->isSMTP();
    $mail->Host = 'localhost';
    $mail->SMTPAuth = false;
    $mail->Port = 25;
    
    $mail->setFrom('teste@seudominio.com', 'Teste PHPMailer');
    $mail->addAddress('seu-email@gmail.com');
    
    $mail->Subject = 'Teste PHPMailer no HostGator';
    $mail->Body = 'Se você recebeu isso, o PHPMailer está funcionando!';
    
    if ($mail->send()) {
        echo "✅ Email enviado com PHPMailer!";
    } else {
        echo "❌ Falha no PHPMailer";
    }
    
} catch (Exception $e) {
    echo "Erro: " . $mail->ErrorInfo;
}
?>