email using PEAR

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I am running Red Hat 8.0 and have pear enabled in PHP. I have installed
the Socket.php in the PEAR Net/ directory. When I run this test script
It displays the "Mail has been sent message" but no mail arrives in my box.

It was suggested by a friend that using PEAR was easier than setting up
sendmail on my box.

Any suggestions would be greatly appreciated.



$recipients = "";

$headers["From"]    = "";
$headers["To"]      = "";
$headers["Subject"] = "Test message";

$body = "TEST MESSAGE!!!";

$params["host"] = "smtp.server";
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = "user";
$params["password"] = "password";

// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);

$mail_object->send($recipients, $headers, $body);

echo "Mail has been sent!!\n";


Site Timeline