Req #4286 [NEW]: Please Document the BCC
| From: | tommyo at gmail dot com | Date: | Thu, 05 May 2005 16:32:11 +0000 |
| Subject: | Req #4286 [NEW]: Please Document the BCC | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-5984@lists.php.net to get a copy of this message | ||
From: tommyo at gmail dot com
Operating system: Linux
PHP version: 4.3.10
Package: Documentation
Bug Type: Feature/Change Request
Bug description: Please Document the BCC
Description:
------------
Hi,
After spending about an hour searching that net I finally figured out how
to add a BCC to pear mail. I had been trying to add the BBC variable to
the headers array. When finally i noticed that send() takes a mixed type
for the recipiants parameter.
I would be happy to help contribute to the documentation. I have found
myself using PEAR::Mail more and more lately and have discovered more and
more about it using trial and error and reading through the phpdocs. I
think that the community could gain alot by improving the end user
documentation here though.
Thank you!
TOM ONEILL
Reproduce code:
---------------
<?php
include('Mail.php');
//Recipents.. THis is mixed type could simply be
// $recipients = 'test@fake.com';
$recipients['To'] = 'test@fake.com';
$recipients['Bcc'] = 'toneill@sierra-bravo.com';
//Headers you wish for the end user to see. Do not put BCC here!
$headers['From'] = 'test@fake.com';
$headers['To'] = 'test@fake.com';
$headers['Subject'] = 'Test message';
//body
$body = 'Test message';
//Setup the params for the mailer
$params["host"] = 'mail.fake.com';
$params["port"] = 25;
$params["auth"] = true;
$params["username"] = 'test@fake.com';
$params["password"] = '';
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $params);
//send the mail
if($error = $mail_object->send($recipients, $headers, $body)){
echo "Succes";
}else{
echo "failed";
}
?>
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=4286&edit=1
--