在发送多封邮件时隐藏其他收件人 [英] hide others recipients when sending multiple mails

查看:512
本文介绍了在发送多封邮件时隐藏其他收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些这样的代码,在发送邮件到AddAddress和AddBCC显示所有收件人后,我想隐藏所有其他收件人,我怎么可以隐藏你有什么想法?


$ b $如果(!空($ _ POST ['invite'])){
foreach($ _ POST ['invite'] as $ check $ {
}
$ import_emails = implode($ _ POST ['invite'],',');
$ imp_eml = explode(',',$ import_emails);

$ mail-> MsgHTML($ body);
foreach($ imp_eml as $ addr)
{
$ mail-> AddAddress($ addr);
$ mail-> AddBCC($ addr);
}

$ mail = new PHPMailer();
$ mail-> IsSMTP();
$ mail-> From ='info@myweb.com';
$ mail-> FromName ='Someone';
$ mail-> Host ='********';
$ mail-> SMTPAuth = true;
$ mail-> Username ='*******';
$ mail-> Password ='*******';

if($ mail-> Send())
{
echosuccess;
} else {
echofailure;
}
?>


解决方案

从我记得,您可以添加BCC收件人:

  $ mail-> AddBCC(arecipient@domain.com','Person'); 

BCC(Blind Carbon Copy)收件人不会写入邮件标题,因此未显示收到电子邮件的人。


I have some code like this, after sending mail in AddAddress and AddBCC showing all recipients, I want to hide all others recipients, how can i hide it have you any idea?

<?php
if(!empty($_POST['invite'])) {
foreach($_POST['invite'] as $check) {
    }
$import_emails =  implode($_POST['invite'], ',');
$imp_eml = explode(',', $import_emails);

$mail->MsgHTML($body);
foreach ($imp_eml as $addr)
  {
$mail->AddAddress($addr);
$mail->AddBCC($addr);
 }  

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = 'info@myweb.com';
$mail->FromName = 'Someone';
$mail->Host = '********';
$mail->SMTPAuth = true; 
$mail->Username = '*******';
$mail->Password = '*******';

if($mail->Send())
{
echo "success";
} else {
echo "failure";
}
?> 

解决方案

From what I recall, you can add BCC recipients using :

$mail->AddBCC('recipient@domain.com', 'Person');

BCC (Blind Carbon Copy) recipients are not writen to the mail headers, and therefore, are not shown to anyone receiving the e-mail.

这篇关于在发送多封邮件时隐藏其他收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆