PHP:为什么mail()在有多个收件人时不会发送密件抄送? [关闭]

I´m testing mail() capabilities, and I have this form field named "mailList" which is a textarea witha couple of mails separated by commas.

So here´s my input form: <textarea name="listadoMails"></textarea>

And I´m trying this:

$listadoMails = $_POST["listadoMails"];

$para   = 'myOwnMail@gmail.com';
$asunto = $_POST['subject'];
$mensaje = $_POST['mensaje'];
$headers = 'From: myOwnMail@mysite.com';
$headers .= 'Bcc: '.$listadoMails. "
";
$headers  = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";


if($_POST['listadoMails']) {
    //mando mail a los usuarios
    $envioUsuarios = mail($para, $asunto, $mensaje, $headers);
    }

if($envioUsuarios) { // I then echo a message that the email was successfully sent.
    echo 'Se envió mensaje a '. $listadoMails;  
}

Te message appears as successfully sent. The mail is just sent to my own email, and the From line in that only email sent is "Nobody "

So I have two issues really:

BBC emails are not sent, and the From address won´t work either!

I´ve found that it was a silly mistake:

$headers  = 'MIME-Version: 1.0' . "
";

should have been

$headers  .= 'MIME-Version: 1.0' . "
";

I didn´t add that line to the first one and everything broke.

I think it is because you forgot to use " " at the end of from header.


Hope it help