//test.php in test folder require_once __DIR__.'/../vendor/autoload.php'; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; $mail = new PHPMailer(true); try {} catch (Exception $e) {}