# Getting email BCC to work

**URL:** <https://forum.kirupa.com/t/getting-email-bcc-to-work/268886>\
**Category:** programming\
**Created:** [August 20, 2008, 2:53am UTC](https://forum.kirupa.com/t/getting-email-bcc-to-work/268886 "2008-08-20T02:53:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [August 20, 2008, 2:53am UTC](https://forum.kirupa.com/t/getting-email-bcc-to-work/268886/1 "2008-08-20T02:53:53Z")

</div>

```auto

    if($msg=="") {
        $to = "me@whereever.com";
        $subject = $mail_subject;
        $body = stripslashes($mail_message);
        $body .= "

---------------------------
";
        $body .= "Mail sent by: " . $mail_name . " <" . $mail_email . ">
";
        $header = "From: Superman <" . $to . ">
";
        $header .= "Bcc: " . $blind_copy . "
";
        $header .= "Content-type: text/plain; charset=us-ascii
";
        $header .= "Content-Transfer-Encoding:7bit
";
        $header .= "X-Mailer: PHP/" . phpversion() . "
";
        $header .= "X-Priority: 1";
        if(@mail($to, $subject, $body, $header)) {
            $thanks = true;
            $msg = "<br/><br/>Thank you for your contact, we will respond to your message as soon as possible.";
        } else {
            $msg = "<br/><br/>Email can not send, please try again later.";
        }
    }
}
$type = (!empty($_REQUEST["type"]))?$_REQUEST["type"]:"";
switch($type) {
    // Other cases omitted
    case "europe": $mail_subject = "Contact Europe"; $send_to = "me@yahoo.com"; $blind_copy = "bob@wherever.com,heidi@yahoo.com"; break;
}

```

I would like to pass the value of $blind\_copy to the

```auto
$header .= "Bcc: " . $blind_copy . "
";

```

line of code. So far it’s not working, so i wondered if anyone else knows how to fix the syntax. I’m assuming it’s OK to have two recipients for BCC.
