I'm trying to send e-mail using PEAR's Mail class--for testing purposes
actually, I've never had any problem with conventional mail(). This is
what my code looks like:
$mail_object=&M ail::factory('s endmail', $params);
if($mail_object->send($to, $headers, $body)){
header('Locatio n: '.$url_ok);
}else{
header('Locatio n: '.$url_ko);
}
This works (i.e., sends mail) but I know it isn't fine. My code never
shows any error, even after removing sendmail link... The send() method
returns "TRUE or a PEAR_Error object, if fails" and I just can't figure
out how to use that. PEAR online manual doesn't include an example of
error handling, at least in this chapter, and I'm rather new to object
oriented programming. I'd greatly appreciate a little example.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
actually, I've never had any problem with conventional mail(). This is
what my code looks like:
$mail_object=&M ail::factory('s endmail', $params);
if($mail_object->send($to, $headers, $body)){
header('Locatio n: '.$url_ok);
}else{
header('Locatio n: '.$url_ko);
}
This works (i.e., sends mail) but I know it isn't fine. My code never
shows any error, even after removing sendmail link... The send() method
returns "TRUE or a PEAR_Error object, if fails" and I just can't figure
out how to use that. PEAR online manual doesn't include an example of
error handling, at least in this chapter, and I'm rather new to object
oriented programming. I'd greatly appreciate a little example.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Comment