PHPMailer::clearCCs PHP 메소드

clearCCs() 공개 메소드

Clear all CC recipients.
public clearCCs ( ) : void
리턴 void
    public function clearCCs()
    {
        foreach ($this->cc as $cc) {
            unset($this->all_recipients[strtolower($cc[0])]);
        }
        $this->cc = array();
        $this->clearQueuedAddresses('cc');
    }

Usage Example

예제 #1
0
 /**
  * Test addressing.
  */
 public function testAddressing()
 {
     $this->assertFalse($this->Mail->addAddress(''), 'Empty address accepted');
     $this->assertFalse($this->Mail->addAddress('', 'Nobody'), 'Empty address with name accepted');
     $this->assertFalse($this->Mail->addAddress('*****@*****.**'), 'Invalid address accepted');
     $this->assertTrue($this->Mail->addAddress('*****@*****.**'), 'Addressing failed');
     $this->assertFalse($this->Mail->addAddress('*****@*****.**'), 'Duplicate addressing failed');
     $this->assertTrue($this->Mail->addCC('*****@*****.**'), 'CC addressing failed');
     $this->assertFalse($this->Mail->addCC('*****@*****.**'), 'CC duplicate addressing failed');
     $this->assertFalse($this->Mail->addCC('*****@*****.**'), 'CC duplicate addressing failed (2)');
     $this->assertTrue($this->Mail->addBCC('*****@*****.**'), 'BCC addressing failed');
     $this->assertFalse($this->Mail->addBCC('*****@*****.**'), 'BCC duplicate addressing failed');
     $this->assertFalse($this->Mail->addBCC('*****@*****.**'), 'BCC duplicate addressing failed (2)');
     $this->assertTrue($this->Mail->addReplyTo('*****@*****.**'), 'Replyto Addressing failed');
     $this->assertFalse($this->Mail->addReplyTo('*****@*****.**'), 'Invalid Replyto address accepted');
     $this->assertTrue($this->Mail->setFrom('*****@*****.**', 'some name'), 'setFrom failed');
     $this->assertFalse($this->Mail->setFrom('[email protected].', 'some name'), 'setFrom accepted invalid address');
     $this->Mail->Sender = '';
     $this->Mail->setFrom('*****@*****.**', 'some name', true);
     $this->assertEquals($this->Mail->Sender, '*****@*****.**', 'setFrom failed to set sender');
     $this->Mail->Sender = '';
     $this->Mail->setFrom('*****@*****.**', 'some name', false);
     $this->assertEquals($this->Mail->Sender, '', 'setFrom should not have set sender');
     $this->Mail->clearCCs();
     $this->Mail->clearBCCs();
     $this->Mail->clearReplyTos();
 }
All Usage Examples Of PHPMailer::clearCCs