email using PEAR

This is a discussion on email using PEAR within the PHP Language forums, part of the PHP Programming Forums category; I grabbed the following script from a website and installed the Socket.php file in the /usr/share/pear/Net ...


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 grabbed the following script from a website and installed the
Socket.php file in the /usr/share/pear/Net directory on a RH 8.0 Linux
box. When I run the script it displays the "Mail sent" message but no
mail actually arrives in my mailbox.

include("Mail.php");

$recipients = "brunowright@yahoo.com";

$headers["From"] = "brunowright@yahoo.com";
$headers["To"] = "brunowright@yahoo.com";
$headers["Subject"] = "Test message";

$body = "TEST MESSAGE!!!";

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

// 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";

?>

I was told that it was much easier to use PEAR than to try setting up
sendmail on my system.

Any comments would be greatly appreciated.

David
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:21 AM.


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