PHP mail: Multiple recipients?

前端 未结 5 1664
暗喜
暗喜 2020-12-01 09:27

I have this code:



        
5条回答
  •  遥遥无期
    2020-12-01 09:43

    According to Alex's answer above, recipients will know the first person in the list even if you're using BCC. A solution for this would be to send individual copies to each address one by one.

    $emails = ['a@example.com', 'b@example.com', 'c@example.com'];
    foreach ($emails as $email){ // or $result as $row
      mail(
        $email, // or $row['address']
        'Same Subject',
        'Same Content',
        'From: same_sender@example.com',
        '-f same_sender@example.com'
      );
    }
    

提交回复
热议问题