Thanks!

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Set your mail to field to null, and then implode your $to array in your headers

$headers .= 'From: SmsGratisan.com <[email protected]>' . "\r\n";
$headers .= 'BCC: '. implode(",", $to) . "\r\n";


mail(null, $title, $content, $headers);

Solution 2

$headers .= 'Bcc: [email protected]' . "\r\n";

Solution 3

CC and BCC can be sent as headers (see: http://php.net/manual/en/function.mail.php).

You can also use other mail libraries – the PEAR Mail library makes sending emails a little more object-oriented. http://pear.php.net/package/Mail/redirected

Solution 4

Please use pass Just Array instead of doing any kind of Implode, Set quotes, comma etc.

Example:

    $bcc = array();

    foreach ($users as $user) 
    {
        $bcc[] = $user['User']['email'];
    }   

And pass This To Mail Function:

        $email->from($from)
//            ->to($from)
              ->bcc($bcc)

Thanks,
Ankit Patel

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply