email using PEAR

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Wright

    email using PEAR

    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.p hp");

    $recipients = "davidwright@sy mpatico.ca";

    $headers["From"] = "myaddress@host .com";
    $headers["To"] = "myaddress@host .com";
    $headers["Subject"] = "Test message";

    $body = "TEST MESSAGE!!!";

    $params["host"] = "smtp.serve r";
    $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($recipien ts, $headers, $body);

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

    ?>
Working...