繁体   English   中英

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

[英]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>

使用密件抄送

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM