Re: Re: PEAR mail problem

From: Date: Fri, 07 Mar 2008 08:07:35 +0000
Subject: Re: Re: PEAR mail problem
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28611@lists.php.net to get a copy of this message
paul singh wrote:
Thank you for writing back, I appreciate it. I do understand the logic, however, from my laptop, the code works perfectly. I can run the exact same code and it works. However, when I try it using my school's server, it fails. Am I missing something? Do I have to include a class, I've been trying to troubleshoot this error for a while now.
PEAR_Error was a workaround for the lack of Exceptions in PHP <5. The fact that $smtp is a PEAR_Error means there was an error somewhere inside Mail::factory(). You'll need to check that $smtp is an error and if it is, quit (or throw an exception) and display the error's message: $smtp = Mail::factory(...); !PEAR::isError($smtp) or die($smtp->getMessage()); -- David Sanders shangxiao

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