Re: Mail Error Capture?
| From: | Stefan Neufeind | Date: | Sun, 07 Mar 2004 01:23:41 +0000 |
| Subject: | Re: Mail Error Capture? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11138@lists.php.net to get a copy of this message | ||
On 7 Mar 2004 at 1:06, KOYAMA Tetsuji wrote:
> At Sat, 6 Mar 2004 09:16:53 -0600,
> Ryan Farrington wrote:
> > Hey all,
> > I got some sample code from a book that uses the following code:
> >
> > $_oMail =& Mail::factory("mail");
> > if(Mail::isError($_oMail)){
> > //do some error processing here
> > }
> >
> > The issues become this: is there is no Mail::isError, and I realy
> > don't know how Mail would generate an error that can be captured.
> > Can anyone provide an example or a better description of what
> > Mail.php does with errors?
>
> Mail class returns PEAR_Error object when error occured. It will be
> able to check by using PEAR::isError. This is PEAR basics. :-)
>
> $_oMail =& Mail::factory('mail');
> if (PEAR::isError($_oMail)){
> //do some error processing here
> }
It could be that Mail once extended from PEAR when that book was
written? In that case, yes, there might have been a Mail::isError
printed some time ago - but it's not up-to-date. Which book are you
refering to?
Regards,
Stefan