Pear mail Setup



I have greatly benefited from usenet so I think it is time to feed back
a bit.

I just tried to set up Pear to handle mail on my php powered website.
Since I am new to Pear so I wanted to run a test script. I cut and
paste from <http://pear.php.net/manual/en/package.mail.mail.send.php>
a example code as follows:

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

$recipients = 'joe@xxxxxxxxxxx';

$headers['From'] = 'richard@xxxxxxxxxxx';
$headers['To'] = 'joe@xxxxxxxxxxx';
$headers['Subject'] = 'Test message';

$body = 'Test message';

$params['sendmail_path'] = '/usr/lib/sendmail';

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

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

I named it as mail3.php and upload to my web server and run. guess what
it didn't! It take me 2 hours to study the manual and other web sources
to figure out that this script sucks. I changed contents and now it
works. If anyone are interested to know I can post my hard-found(to me
at least)solution up.

What I can say, Pear is great but the docs, well, sucks.

.



Relevant Pages