Fatal error: Class 'PEAR' not found in Socket.php on line 35
| From: | Partha Ghosh | Date: | Mon, 18 May 2009 14:22:05 +0000 |
| Subject: | Fatal error: Class 'PEAR' not found in Socket.php on line 35 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-29861@lists.php.net to get a copy of this message | ||
Hi,
Thanks all, pear mail package is now installed in my windows host. But I get
the following error message while sending email.
Fatal error: Class 'PEAR' not found in C:\Program
Files\Parallels\Plesk\Additional\PleskPHP5\Pear\Net\Socket.php on line 35
What else should I be checking? Here is the sample code.
<?php
require_once("PEAR.php");
require_once("Mail.php");
$from = "fromname <info@from.com>";
$to = "toname <name@to.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "hostname here";
$username = "username here";
$password = "PW here";
$headers = array ('From' => $from,'To' => $to,'Subject' =>
$subject);
$smtp = Mail::factory('smtp',array ('host' => $host,'auth' =>
true,'username' => $username,'password' => $password));
$mail = $smtp->send($to, $headers, $body);
?>
Thanks,
Partha