php – Getting an error when calling a method from another class-ThrowExceptions

Exception or error:
require_once 'dbconfig.php';
class USER {

  function send_mail($email,$message,$subject) {

    $mail = new PHPMailer();
    $mail->SMTPDebug  = 0;                     
    $mail->SMTPAuth   = true;                  
    $mail->SMTPSecure = "ssl";                 
    $mail->Host       = "";      
    $mail->Port       = 465;             


That’s the first class and then I want to call the send_mail method in the following page


$userEmail = 'blank';
$SYSID = 'blank';
$SYSTEM = 'blank';
$userID = 'blank';

require_once 'dbconfig.php';
require_once 'class.user.php';

$user = new USER();

$user->send_mail("", "TEST", "TEST");

The $user = new USER(); line causes my page not to load.

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *