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

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

$mail = new PHPMailer(true);
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';

try {
    $mail->isSMTP();
    $mail->Host = 'smtppro.zoho.in';
    $mail->SMTPAuth = true;
    $mail->Username = 'contact@topseniorproduct.com';
    $mail->Password = 'FGcxkbAfuFhg'; // 🛑 Must be Zoho App Password!
     $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // OR try STARTTLS
    $mail->Port = 465; // OR try 587 with STARTTLS

    $mail->setFrom('contact@topseniorproduct.com', 'Unique');
    $mail->addAddress('vinothkumar@vintorix.com');
    $mail->isHTML(true);
    $mail->Subject = 'Zoho SMTP Test';
    $mail->Body = '<p>This is a test email sent from PHPMailer using Zoho SMTP.</p>';

    $mail->send();
    echo '✅ Email sent!';
} catch (Exception $e) {
    echo '❌ Mailer Error: ' . $mail->ErrorInfo;
}
?>
