Hi guys.
I'm having trouble with this PEAR script that I have in PHP. Basically I want to send emails to two people: 1) the Recipient selected via drop-down and 2) the creator of the comments. So I looked up the PEAR information, and tried my hand at it. This is what I came up with:
Config.php
<?php
$method = 'smtp';
$params['sendmail_path'] = "/usr/sbin/sendmail";
$params['host'] = "mail.ridgeswimclub.org";
$params['port'] = "25";
$params['auth'] = "TRUE";
$params['username'] = "ridgeswi";
$params['password'] = "*******";
?>
Mail Script
$recips = $Recip.'; ';
$recips .= $Email;
require_once('config.php');
$headers['From'] = $Name." <".$Email.">";
$headers['Subject'] = $Subject;
$headers['To'] = $Recip;
$headers['Cc'] = $Email;
require_once('Mail.php');
$mail_object =& Mail::factory($method, $params);
$mail_object->send($recips, $headers, $message);
if($mail_object != 'TRUE'){
require_once('PEAR.php');
$error = PEAR_Error::toString();
echo "<b>".$error."</b>";
$_REQUEST['pageid'] = '23';
}
else{
$_REQUEST['pageid'] = '22';
}
So when I run this script, I get the following output:
[: message="" code=0 mode= level= prefix="" info=""]
But, if I change the if() statement to be:
if(PEAR::isError($mail_object))
I don't get an error, but don't receive email either.
Can anyone see anything wrong with this? It's late, and I must sleep.
If anyone can help, that would be appreciated.
~Brett