Search code examples
phpxampppear

Fatal error: class not found using pear in xampp


I'm trying to send an email using form data. I'm adapting the method described at http://www.html-form-guide.com/email-form/php-email-form-attachment.html which uses the PEAR library. I'm testing my site locally via XAMPP.

Here's the code from the top of my page:

<?php 
// Pear library includes
include_once('Mail/mail.php');
include_once('Mail/mime.php');

Testing the page produces the following:

Fatal error: Class 'Mail' not found in C:\xampp\php\PEAR\Mail\mail.php on line 51

Here's line 51 from mail.php (I haven't altered the file from the default XAMPP installation):

class Mail_mail extends Mail {

Any help would be much appreciated.


Solution

  • try changing

    include_once('Mail/mail.php');
    

    to

    include_once('Mail.php');