| Jeroen Houben 2005-06-09, 3:57 pm |
| Hi,
I think there is some non intuitive behaviour in PEAR::Mail.
This will work fine
$body = 'test';
$headers['To'] = 'mail@domain1.com';
$headers['Cc'] = 'mail@domain2.com';
$headers['From'] = 'from@domain3.com';
$headers['Subject'] = 'test';
$result = $mailer->send(array($headers['To'], $headers['Cc']) ,
$headers, $body);
but this won't, it will not send anything to the CC
$body = 'test';
$headers['To'] = 'mail@domain1.com';
$headers['Cc'] = 'mail@domain2.com';
$headers['From'] = 'from@domain3.com';
$headers['Subject'] = 'test';
$result = $mailer->send($headers['To'], $headers, $body);
What I conclude form this is that you have to specify all recipients in
the first parameter, even the ones in CC and BCC. This seems a bit
strange to me and IIRC this is not the way PHP's mail() function behaves.
Jeroen
|