Re: PEAR::Mail CC - strange behaviour
| From: | Jeroen Houben | Date: | Thu, 09 Jun 2005 14:25:56 +0000 |
| Subject: | Re: PEAR::Mail CC - strange behaviour | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19574@lists.php.net to get a copy of this message | ||
Scott Mattocks wrote:
Jeroen Houben wrote:JeroenHi, I think there is some non intuitive behaviour in PEAR::Mail.<snip>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.I don't think it has anything to do with the PEAR or PHP. I have run into this problem with both approaches. From what I could find, this is an MTA thing. All PEAR::Mail or PHP mail() is doing is creating a message and setting some headers. Then it passes the message along to the MTA. It is upto the MTA to check for the CC address and send the message to them. Our MTA does not do that. The reason your first example works is because you are telling PEAR::Mail to tell the MTA to send the message twice, once to the To address and once to the Cc address. The second example you are only telling the MTA to send the message to one address. Who you are sending it to with the first argument has nothing to do with the headers you are setting in the second argument. This may all well be true, but all I'm asking is to change the code in PEAR::Mail so example number one works just like example number 2: send mail to both the to address and the CC address. I think that could be done no matter which MTA you are using. How it's handled internally is not all that important IMHO.