さて、私はこのコードを手に入れました、それは動作しますが、PHPMailerのすべてのループを設定する必要があります。それが良い場合はidkですが、すべてのループを設定しないと変更されません。
foreach($this->users as $v)
{
$this->phpmailer = new PHPMailer();
$this->phpmailer->IsSMTP();
$this->phpmailer->SMTPAuth = true;
$this->phpmailer->SMTPSecure = 'ssl';
$this->phpmailer->Host = 'smtp.gmail.com';
$this->phpmailer->Port = 465;
$this->phpmailer->ClearAllRecipients();
$this->phpmailer->AddAddress($v['email']);
$this->phpmailer->Username = $v['email_user'];
$this->phpmailer->Password = $v['email_pass'];
$this->phpmailer->From = $v['email_user'];
$this->phpmailer->FromName = $v['email_name'];
...
動作しますが、ループごとに PHPMailer を設定していますが、そうすると:
$this->phpmailer = new PHPMailer();
$this->phpmailer->IsSMTP();
$this->phpmailer->SMTPAuth = true;
$this->phpmailer->SMTPSecure = 'ssl';
$this->phpmailer->Host = 'smtp.gmail.com';
$this->phpmailer->Port = 465;
foreach($this->users as $v)
{
$this->phpmailer->ClearAllRecipients();
$this->phpmailer->AddAddress($v['email']);
$this->phpmailer->Username = $v['email_user'];
$this->phpmailer->Password = $v['email_pass'];
$this->phpmailer->From = $v['email_user'];
$this->phpmailer->FromName = $v['email_name'];
...
それは機能しますが、 from はすべてのループを変更しません。