Re: Mail Error Capture?

From: Date: Sat, 06 Mar 2004 16:06:06 +0000
Subject: Re: Mail Error Capture?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11135@lists.php.net to get a copy of this message
Hi, 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 } -- koyama@hoge.org koyama@beatraft.com KOYAMA Tetsuji BeatCraft, Inc., Tokyo, Japan.

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