phpMailer - How do you Remove Recipients

后端 未结 2 1439
傲寒
傲寒 2020-12-03 00:15

There are a lot of StackOverflow questions on this topic, but I couldn\'t find one that was able to help with the issue I\'m having. The script that I\'m writing sends out m

相关标签:
2条回答
  • 2020-12-03 01:04

    im using this always before sending email to recipients:

    // clear addresses of all types
    $mail->ClearAddresses();  // each AddAddress add to list
    $mail->ClearCCs();
    $mail->ClearBCCs();
    

    then im doing just this: (not using CC or BCC, $toaddress is just an array of recipients)

    foreach($toaddress as $key=>$val) { $mail->AddAddress( $val ); }
    

    im using PHPMailer 5.2

    0 讨论(0)
  • 2020-12-03 01:09

    You can use ClearAllRecipients( )

    $mailer->ClearAllRecipients( ); // clear all

    0 讨论(0)
提交回复
热议问题