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

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

$mail = new PHPMailer(true);

try {
    $mail->isSMTP();
    $mail->Host       = 'havenclean.me'; // ✅ use this
    $mail->SMTPAuth   = true;
    $mail->Username   = '_mainaccount@havenclean.me';
    $mail->Password   = 'Baseline@7777';
    $mail->SMTPSecure = 'ssl';
    $mail->Port       = 465;

    $mail->SMTPDebug = 2;
    $mail->Debugoutput = 'html';

    $mail->setFrom('_mainaccount@havenclean.me', 'Haven Clean');
    $mail->addAddress('gurmeet85611@gmail.com');

    // ✅ REQUIRED
    $mail->isHTML(true);
    $mail->Subject = 'Test Email';
    $mail->Body    = 'Hello, this is a test email from cPanel SMTP!';

    $mail->send();
    echo "Email Sent Successfully!";
} catch (Exception $e) {
    echo "Error: {$mail->ErrorInfo}";
}