email using PEAR

This is a discussion on email using PEAR within the PHP Language forums, part of the PHP Programming Forums category; I am running Red Hat 8.0 and have pear enabled in PHP. I have installed the Socket.php in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-21-2004
David Wright
 
Posts: n/a
Default 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.php");

$recipients = "davidwright@sympatico.ca";

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

?>
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0