<?php

/**
 * Backward-compatible loader for the legacy application.
 *
 * The application historically instantiated PHPMailer 5.x classes from the
 * global namespace. PHPMailer 7 uses namespaced classes. These aliases retain
 * the existing application API while loading the supported implementation.
 */

require_once __DIR__ . '/src/Exception.php';
require_once __DIR__ . '/src/PHPMailer.php';
require_once __DIR__ . '/src/SMTP.php';
require_once __DIR__ . '/src/POP3.php';

if (!class_exists('PHPMailer', false)) {
    class_alias(\PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer');
}

if (!class_exists('phpmailerException', false)) {
    class_alias(\PHPMailer\PHPMailer\Exception::class, 'phpmailerException');
}

if (!class_exists('SMTP', false)) {
    class_alias(\PHPMailer\PHPMailer\SMTP::class, 'SMTP');
}

if (!class_exists('POP3', false)) {
    class_alias(\PHPMailer\PHPMailer\POP3::class, 'POP3');
}
