我正在測試mail()功能,並且我有一個名爲「mailList」的表單域,它是一個用逗號分隔的幾個郵件的textarea。PHP:爲什麼mail()在有多個收件人時不會發送密件抄送?
所以here's我的輸入形式:<textarea name="listadoMails"></textarea>
而我正嘗試這樣:
$listadoMails = $_POST["listadoMails"];
$para = '[email protected]';
$asunto = $_POST['subject'];
$mensaje = $_POST['mensaje'];
$headers = 'From: [email protected]';
$headers .= 'Bcc: '.$listadoMails. "\r\n";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
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;
}
特出現一條消息,爲成功發送。郵件只是發送給我自己的電子郵件,以及從線中,只有電子郵件發送是「沒人」
所以,我有兩個問題,真正做到:
BBC電子郵件不發送,發件人地址也不行!
使用SMTP郵件程序,例如'PHPMailer'see here http://phpmailer.worxware.com – ErickBest