php – Hide the list of other message recipients from 1 recipient



How can the recipient of the letter see his e-mail in the "to" field, but without a list of other e-mails?

Operating time:


$from = '';//email отправителя 
$to = '<>, <>'; 
$subject = 'Тема'; 
$body= 'Текст письма'; 
$mailheaders = "Content-type:text/html;charset=utf-8\r\n"; 
$mailheaders .= "From:\r\n"; 
$mailheaders .= "Reply-To:\r\n"; 
// почтовые заголовки

$mailheaders .= "Bcc:\r\n";
$mailheaders .= "Bcc:\r\n";
mail($to, stripslashes(trim($subject)), stripcslashes($body), $mailheaders);


Those. so that the user mail1 does not see the mail2 soap and vice versa. Of course you can do $ to = ''; and then the user will be shown "hidden recipients", but he still wants the field to whom to be filled in, and to be filled in correctly.


Here's a good way for you, I think:


$email1 = array("");
$listmails = array("","","");
$ready_email_list = array_diff($listmails,$email1); // здесь список емайлов, отличных 
                                                       от $email1
print_r($ready_email_list); // "[0] => [2] => "

Scroll to Top