[thelist] PEAR::Mail help

Beau Hartshorne beau at members.evolt.org
Mon Aug 19 11:29:00 CDT 2002


Hi,

I've recently discovered and started to take advantage of the PEAR code
repository. For the uninitated, here are a few links to help get you
started:

http://pear.php.net/ (the main site)
http://pear.php.net/packages.php (package list)
http://pear.php.net/manual/en/ (manual)

I want to use the PEAR::Mail class to send a mail message. I've read
through the documentation here:

http://pear.php.net/manual/en/core.mail.php

and have been able to send messages to myself using this code:

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

$recipient = 'joe at example.com'; // I use my real email address here
$headers['From']    = 'richard at phpguru.org';
$headers['Subject'] = 'Test message';
$body = 'Test message';
Mail::send($recipient, $headers, $body);
?>

When I check my messages, there's always an extra newline inserted at
the beginning of the message, like this:

------------------------------------------

Test message
------------------------------------------

If I just use the regular mail() function, I don't get that extra space
at the beginning.

Has anyone else noticed this before?

Thanks,

Beau





More information about the thelist mailing list