For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2005 > Re: [PEAR] 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 Re: [PEAR] PEAR::Mail CC - strange behaviour
Scott Mattocks

2005-06-09, 3:57 pm

Jeroen Houben wrote:
> Hi,
>
> 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.

--
Scott Mattocks
scott@crisscott.com
http://www.crisscott.com
Jeroen Houben

2005-06-09, 3:57 pm

Scott Mattocks wrote:

> Jeroen Houben wrote:
>
>
>
> <snip>
>
>
>
> 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.

Jeroen
Sponsored Links







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

Copyright 2008 codecomments.com