By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

email using PEAR

P: n/a
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.

David

<?php
include("Mail.php");

$recipients = "da*********@sympatico.ca";

$headers["From"] = "my*******@host.com";
$headers["To"] = "my*******@host.com";
$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";

?>
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.