Re: PEAR mail problem

From: Date: Fri, 07 Mar 2008 04:10:48 +0000
Subject: Re: PEAR mail problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28608@lists.php.net to get a copy of this message
If you read the manual, you'll find that Mail::factory() may also return a PEAR_Error upon failure. Therefore $smtp becomes a PEAR_Error and you try to call PEAR_Error->send() which does not exist. paul singh wrote:
Hello, I love this script due to it simplistic setup and I had it working on my laptop running locally. However, I have run into some major issues when I transferred my files, including the script, to a server. PHP 5.0 is installed on the server, and I have been getting the following issue: Fatal error: Call to undefined method PEAR_Error::send() ----------------------CODE----------------- $from = "Webmaster <paulsingh10@hotmail.com>"; $to = "<paulsingh10@hotmail.com>"; $subject = "Registration Confirmation"; $body = "\n\nYour account is pending approval, please be patient.\n\nThank you,\nPRWR Webmaster."; $host = "ssl://smtp.gmail.com"; $port = "465"; $username = "*********"; $password = "*********"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host,
    'port' => $port,
    'auth' => true,
    'username' => $username,
    'password' => $password));
$mail = $smtp->send($to, $headers, $body); --LINE 35 BTW if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else {} I believe PEAR is installed, but is this the issue why I am having problems? Do I have to include it's path. Please I need help with this issue, it is rather urgent. I thank you for your time, Paul
-- David Sanders Software Engineer Baseline Solutions Pty Ltd Suite 201 832 High St East Kew VIC 3102 Australia Phone: (03) 9249 9687 Fax: (03) 9249 9600 http://baselinesolutions.com.au ======================================================================== This e-mail contains privileged and confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in reliance on it. Please notify Baseline Solutions Pty Ltd via e-mail (security@baselinesols.com) if you are not the intended addressee of this e-mail transmission. Any views or opinions presented in this message are solely those of the author. ========================================================================

« previous php.pear.general (#28608) next »