问题
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.
回答1:
try changing
include_once('Mail/mail.php');
to
include_once('Mail.php');
来源:https://stackoverflow.com/questions/12989183/fatal-error-class-not-found-using-pear-in-xampp