Thursday, 15 July 2010

php - Pear Mail "Unable to find class for driver smtp" Cannot find file, that is there -



php - Pear Mail "Unable to find class for driver smtp" Cannot find file, that is there -

my vps running centos 5.3. have installed pear, mail, , net_mail. when seek send mail, get, "unable find class driver smtp". looked through mail.php, found need 'mail/smtp.php' within pear directory, there is. verified php include directory, , reset of perms apache via chown. checked chmod, , 644.

my code:

$from = "admin <admin@myemail.com>"; $to = "new user <".$email.">"; $subject = "welcome myemail!"; $body = "thanks choosing <myemail>! strive provide 24/7 email service , support. if have issues, concerns, etc, please reply email, or compose new 1 to: myemail@email.com !"; $host = "localhost"; $username = "username"; $password = "password"; $headers = array ('from' => $from, 'to' => $to, 'subject' => $subject); $smtp = mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); if (pear::iserror($smtp)) { echo("<p>" . $smtp->getmessage() . "</p>"); } $mail = $smtp->send($to, $headers, $body); if (pear::iserror($mail)) { echo("<p>" . $mail->getmessage() . "</p>"); } else { echo("<p>message sent!</p>"); }

the code gave works here, when adding require_once 'mail.php'; @ beginning.

what md5 hash has mail/smtp.php file on server? contain class mail_smtp line?

here is: 479aa21ec86e63e629db646ed292b142 (via md5sum /usr/share/php/mail/smtp.php)

php linux email centos pear

No comments:

Post a Comment