phpMailer - How do you Remove Recipients

只谈情不闲聊 提交于 2019-11-27 12:34:04
GDP

You can use ClearAllRecipients( )

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!