I am trying to set up Pear mail to be able to send mail from an authenticated SMTP server. I found the Mail.php in my /usr/share/php/Mail directory. It has a $factort() method. The test code crashes when the Mail::factory() method is called and I am not able to find any exception output or error message.
Any suggestion would be appreciated.
TEST CODE:
echo "include path = $includePath </br>";
echo("************before mail factory call vers 31 ********************* </br>");
include '/Mail/Mail.php';
include '/Mail/mail.php';
include '/Mail/mime.php';
include '/Mail/smtp.php';
$host = "smtp.centurylink.net";
$port="25";
$username = "#####@#####.net";
$password = "#####";
try{
echo("port = $port, username = $username, password=$password </br>");
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
if(!$smtp) throw new Exception('noSmtp');
} catch(Exception $e) {
echo "would like to see why </br>";
echo "$e->getTraceAsString() ";
}
echo("after mail factory </br>");
OUTPUT:
include path = .:/usr/share/php:/usr/share/pear
*********before mail factory call vers 31 ******************
port = 25, username = [email]#####@#####.net[/email], password=#####
...................................................................
There was no additional output and no error message generated either in the php or Apache error logs.