Well something weird is going on here.
Both my dev and prod machines are PHP 4.2.2
They might have some differences since they are not distributed from the same people.
One RH8 the other is a network applicace called an InstaRak.

At home on RH8 everything was fine...  on the appliance I needed to remove the "\r" 
(was terminating all header lines with "\r\n") on the end of my header strings.
Otherwise the To: mail was fine however the Bcc: mail was ignoring the headers and 
including them in the mail message.


So just for archives sake... This is how it workes on an InstaRak.



        $toname = "Some Guy";
        $tomail = "[EMAIL PROTECTED]";

        $subject     ="My Subject.";
        $message .="My Message.\n\n";

        $headers  = "Date: " . date("r", mktime ()) . "\n";
        $headers .= "From: \"User Name\" <[EMAIL PROTECTED]>\n";
        if ($_POST['cc']){
                $headers .= "Bcc: [EMAIL PROTECTED]\n";
        }
        $headers .= "Reply-To: \"User\" <[EMAIL PROTECTED]>\n";
        $headers .= "MIME-Version: 1.0\n";
        $headers .= "X-Mailer: MyWebMail v1.B\n";
        $headers .= "Content-type: text/plain; charset=us-ascii\n";
        $headers .= "X-Priority: 2\n";
        $headers .= "X-MSMail-Priority: Medium\n";

        if (mail("\"$toname\" <$tomail>", $subject, $message, $headers))
        {
                echo "<p>mail sent</p>";
        }


*********** REPLY SEPARATOR  ***********

On 02/01/2003 at 4:17 AM Jason Wong wrote:

>On Thursday 02 January 2003 03:01, Michael J. Pawlowsky wrote:
>> Has anyone successfully used BCC with mail... (on Linux with sendmail)
>>
>> If so are you using the header:
>>
>> "Bcc: My Name <[EMAIL PROTECTED]>\r\n"
>
>For Bcc it would be pointless to include "My Name" as Bcc recipients are
>not
>displayed. Thus:
>
>  "Bcc: [EMAIL PROTECTED]\r\n"
>
>would be adequate.
>
>If you really want to include a name with the email address then the
>correct
>format is:
>
>  "Bcc: \"My Name\" <[EMAIL PROTECTED]>\r\n"
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.biz
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>
>/*
>"Language shapes the way we think, and determines what we can think about."
>-- B. L. Whorf
>*/
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to