The Send() method of the Pear mail package takes an array of values thus:

$recipients[“To”] = ‘[email protected]’;
$recipients[“Bcc”] = ‘[email protected]’;
$recipients[“Cc”] = ‘[email protected]’;

$header[“From”] = ‘[email protected]’;
$header[“To”] = ‘[email protected]’;
$header[“Subject”] = ‘Subject’;

$body = ‘Hello world!’;

$smtpinfo[“host”] = “”;
$smtpinfo[“port”] = “25”;
$smtpinfo[“auth”] = true;
$smtpinfo[“username”] = “username”;
$smtpinfo[“password”] = “password”;

$smtp = Mail::factory(‘smtp’, $smtpinfo);

$mail = $smtp->send($recipients, $header, $body);

What’s important to note is that the header needs to contain a “To” address, “From” address and a “Subject”. “Cc” or “Bcc” in the header is not required and in fact in the case of “Bcc” is pointless since you’d be giving away who you send the email to in the header information when that is not what you want (or you’d just use “Cc” presumably).


And yes, it’s poorly documented.