PHP Build a Basic PHP Website Adding a Basic Form Utilizing Object Properties and Methods

pups pups
pups pups
1,697 Points

Mailer Error : Could not instantiate mail function.

it says "Mailer Error : Could not instantiate mail function." when i hit send here's my code :

    if (!PHPMailer::validateAddress($email)) // checkes if the email add is valid
    {
        echo "Invald email address.";
        exit;
    }

    $email_body = "";
    $email_body .= "Name " . $name . "\n";
    $email_body .= "Email " . $email . "\n";
    $email_body .= "Details message ". $details . "\n";

    $mail = new PHPMailer;

    $mail->setFrom('propsjane@gmail.com', $name);
    $mail->addReplyTo($email, $name);
    $mail->addAddress('propsjane@gmail.com', 'Jane');
    $mail->Subject = 'Library suggestion from ' . $name;
    $mail->Body = $email_body;
    if (!$mail->send())
    {
        // $msg .= "Mailer Error: " . $mail->ErrorInfo; ewan bat pinalitan
        echo "Mailer Error : " . $mail->ErrorInfo;
        exit;
    } 
    header("location:suggest.php?status=thanks");