For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2005 > PEAR::Mail CC - strange behaviour









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PEAR::Mail CC - strange behaviour
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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com