468,247 Members | 1,468 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

Blind carbon copy

I am running into a strange problem with blind carbon copy. I specify two
addresses, one for the sendto and one for the bcc (both are mine). It
sends two emails, but BOTH are to the sendto address. Here it is:

$from = "me@third.com";
$subject = "testing";
$message = "A set of text";
$sendTo = "me@first.com";
$bcc = "me@second.com";
$message = wordwrap($message, 70);
$headers = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $from . "\r\n";
$headers .= 'Bcc: ' . $bcc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
mail($sendTo, $subject, $message, $headers);
I get two emails at me@first.com. If I switch the two addresses (setting
$sendTo to be me@second.com and $bcc to be me@first.com, then I get two
emails at me@second.com.

What is going on here?

Shelly
Oct 27 '06 #1
5 1921
Shelly wrote:
I am running into a strange problem with blind carbon copy. I specify two
addresses, one for the sendto and one for the bcc (both are mine). It
sends two emails, but BOTH are to the sendto address. Here it is:

$from = "me@third.com";
$subject = "testing";
$message = "A set of text";
$sendTo = "me@first.com";
$bcc = "me@second.com";
$message = wordwrap($message, 70);
$headers = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $from . "\r\n";
$headers .= 'Bcc: ' . $bcc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
mail($sendTo, $subject, $message, $headers);
I get two emails at me@first.com. If I switch the two addresses (setting
$sendTo to be me@second.com and $bcc to be me@first.com, then I get two
emails at me@second.com.

What is going on here?

Shelly

I think you'll find this is working, just that the bcc address is
correctly not being displayed. If you look at the headers for the
received emails, you should see they have gone to the right addresses.
Oct 27 '06 #2

"Jeff Paffett" <jp******@otenet.grwrote in message
news:eh**********@mouse.otenet.gr...
Shelly wrote:
>I am running into a strange problem with blind carbon copy. I specify
two addresses, one for the sendto and one for the bcc (both are mine).
It sends two emails, but BOTH are to the sendto address. Here it is:

$from = "me@third.com";
$subject = "testing";
$message = "A set of text";
$sendTo = "me@first.com";
$bcc = "me@second.com";
$message = wordwrap($message, 70);
$headers = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $from . "\r\n";
$headers .= 'Bcc: ' . $bcc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
mail($sendTo, $subject, $message, $headers);
I get two emails at me@first.com. If I switch the two addresses (setting
$sendTo to be me@second.com and $bcc to be me@first.com, then I get two
emails at me@second.com.

What is going on here?

Shelly

I think you'll find this is working, just that the bcc address is
correctly not being displayed. If you look at the headers for the received
emails, you should see they have gone to the right addresses.
The headers are for the two are virtually identical, but I think I see what
you mean. I am getting two, one by each route, but the "To:" displays the
same for both and the bcc doesn't show at all (as it shouldn't). This would
explain why I am getting two, and yet it appears as if both are being sent
to the same address. The only differences between the two headers is that
in one the addresses are all encased in brackets while in the other they are
not (see below)

To: <me@first.com>
Subject: new test
From: <se****@his.com>
Reply-To: <se****@his.com>
X-Mailer: PHP/5.1.2
Message-Id: <20***********************@euclid.dreamhost.com>
Date: Thu, 26 Oct 2006 18:56:29 -0700 (PDT)

To: me@first.com
Subject: new test
From: se****@his.com
Reply-To: se****@his.com
X-Mailer: PHP/5.1.2
Message-Id: <20***********************@euclid.dreamhost.com>
Date: Thu, 26 Oct 2006 18:56:29 -0700 (PDT)

Is that what you meant?

Shelly

Oct 27 '06 #3
On Fri, 27 Oct 2006 02:09:44 GMT, "Shelly"
<sh************@asap-consult.comwrote:
>I am running into a strange problem with blind carbon copy. I specify two
addresses, one for the sendto and one for the bcc (both are mine). It
sends two emails, but BOTH are to the sendto address.
If you mean that both emails have the same "To: " header, that's quite
normal. If you mean that both emails go to the same mailbox, and the
other mailbox does not receive a copy, that's not normal, but doesn't
appear to be the fault of your code.

hth

-
Remove mypants to email.
<http://www.shaunc.com/>
Oct 28 '06 #4
Shelly wrote:
"Jeff Paffett" <jp******@otenet.grwrote in message
news:eh**********@mouse.otenet.gr...
>Shelly wrote:
>>I am running into a strange problem with blind carbon copy. I specify
two addresses, one for the sendto and one for the bcc (both are mine).
It sends two emails, but BOTH are to the sendto address. Here it is:

$from = "me@third.com";
$subject = "testing";
$message = "A set of text";
$sendTo = "me@first.com";
$bcc = "me@second.com";
$message = wordwrap($message, 70);
$headers = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $from . "\r\n";
$headers .= 'Bcc: ' . $bcc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
mail($sendTo, $subject, $message, $headers);
I get two emails at me@first.com. If I switch the two addresses (setting
$sendTo to be me@second.com and $bcc to be me@first.com, then I get two
emails at me@second.com.

What is going on here?

Shelly

I think you'll find this is working, just that the bcc address is
correctly not being displayed. If you look at the headers for the received
emails, you should see they have gone to the right addresses.

The headers are for the two are virtually identical, but I think I see what
you mean. I am getting two, one by each route, but the "To:" displays the
same for both and the bcc doesn't show at all (as it shouldn't). This would
explain why I am getting two, and yet it appears as if both are being sent
to the same address. The only differences between the two headers is that
in one the addresses are all encased in brackets while in the other they are
not (see below)

To: <me@first.com>
Subject: new test
From: <se****@his.com>
Reply-To: <se****@his.com>
X-Mailer: PHP/5.1.2
Message-Id: <20***********************@euclid.dreamhost.com>
Date: Thu, 26 Oct 2006 18:56:29 -0700 (PDT)

To: me@first.com
Subject: new test
From: se****@his.com
Reply-To: se****@his.com
X-Mailer: PHP/5.1.2
Message-Id: <20***********************@euclid.dreamhost.com>
Date: Thu, 26 Oct 2006 18:56:29 -0700 (PDT)

Is that what you meant?

Shelly
I don't think your email program is displaying the full headers, there's
a Delivered to: field in mine. But they will appear to be delivered to
the same address, yes.
Oct 29 '06 #5
Jeff Paffett <jp******@otenet.grwrote:
>
I don't think your email program is displaying the full headers, there's
a Delivered to: field in mine. But they will appear to be delivered to
the same address, yes.
"Delivered-To:" is a not a standard header. Your mail server is adding
that to help with spam filtering. Some mail servers call it something like
"X-Envelope-To:".
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Hats | last post: by
4 posts views Thread by Zachary | last post: by
1 post views Thread by fortepianissimo | last post: by
reply views Thread by Hats | last post: by
14 posts views Thread by andreyvul | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.