向多个收件人发送电子邮件时看不到其他用户的地址


sending email to multiple recipients not see other users addresses

你好,朋友我通过管理面板在注册用户的电子邮件地址上发送激活链接和代码,工作正常,用户可以获得激活链接和编码。

但问题是users can see other recipients email address In To:我希望用户不能看到其他收件人的电子邮件地址?

这里是我的代码

<?php 
//creating activation code
$alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$length = 11;
for($i=0; $i<$length; $i++){
$ran = rand(0, strlen($alpha)-1);
$new_key .= substr($alpha, $ran, 1);
}   

$activation = 'activation.php?email='.urlencode($_POST['email1']).'&key='.$new_key;
$your_email = 'test@test.com'; 
$domain = $_SERVER["HTTP_HOST"];
$to = implode(',', $_POST['email1']);
$subject = 'Confirmation';
$message = '<font class="font1">
<a href="http://'.$domain.'/'.$activation.'">http://'.$domain.'/'.$activation.'</a></font>';
$headers .= 'MIME-Version: 1.0' . "'r'n";  
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "'r'n";  
$headers .= "From: <$your_email>'r'n" .  
"X-Mailer: PHP/" . phpversion(); 
mail($to, $subject, $message, $headers);
?>

选择用户电子邮件地址的表单

<form name ="checkForm" id="checkForm" method="post">  
<?php 
$query=mysql_query("select semail from students order by id") 
or die ('students query');
while($row=mysql_fetch_array($query))
{
?>
<input type="text" name="email1[]" value="<?php echo $row['semail'] ?>"  />
<?php } ?> 
</form>

使用BCC

$headers .= 'From: Your Name <test@test.com' . "'r'n";
$headers .= 'BCC: '.  implode(',', $_POST['email1']) . "'r'n";
mail(null, $title, $content, $headers);